Skip to content

Commit

Permalink
Fix frontend format
Browse files Browse the repository at this point in the history
  • Loading branch information
mawandm committed Apr 4, 2024
1 parent 7e918ba commit 03c66dd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 deletions.
6 changes: 3 additions & 3 deletions nesis/frontend/client/src/components/MenuHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const MobileMenuTrigger = styled.div`
const HeaderToolBarIcon = styled.div`
margin-left: 20px;
margin-right: 20px;
`
`;

export default function MenuHeader({ onMobileMenuClick }) {
const history = useHistory();
Expand All @@ -96,8 +96,8 @@ export default function MenuHeader({ onMobileMenuClick }) {
<QuestionSquare size={iconSize} className="help-icon" /> Help
</HeaderToolBarIcon>
<HeaderToolBarIcon>
<PersonCircle size={iconSize} className="account-icon" />
{session?.email ? session?.email.split('@')[0] : ''}
<PersonCircle size={iconSize} className="account-icon" />
{session?.email ? session?.email.split('@')[0] : ''}
</HeaderToolBarIcon>
<SignOutButton
onClick={signOut}
Expand Down
40 changes: 18 additions & 22 deletions nesis/frontend/client/src/pages/DocumentGPT/ChatPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,38 +77,36 @@ const StyledTooltip = styled(Tooltip)`
padding: 0.25rem 0.5rem;
color: white;
text-align: center;
background-color: #113BA4;
background-color: #113ba4;
border-radius: 0.25rem;
}
`;

function CopyResourceAttribute({ value }) {

const [isCopied, setIsCopied] = useState(false);
const onCopy = async () => {
await navigator.clipboard.writeText(value);
setIsCopied(true);
setTimeout(() => {
setIsCopied(false);
}, 2000);
}
};

return <OverlayTrigger
trigger='click'
placement='top'
overlay={
<StyledTooltip
id={value}
>
Copied !
</StyledTooltip>
}
show={isCopied}
>
<>
<ContentCopyIcon onClick={onCopy} style={{ marginTop: '2px', color: '#55ce7e', cursor: 'pointer' }} />
</>
</OverlayTrigger>
return (
<OverlayTrigger
trigger="click"
placement="top"
overlay={<StyledTooltip id={value}>Copied !</StyledTooltip>}
show={isCopied}
>
<>
<ContentCopyIcon
onClick={onCopy}
style={{ marginTop: '2px', color: '#55ce7e', cursor: 'pointer' }}
/>
</>
</OverlayTrigger>
);
}

const ChatPage = () => {
Expand Down Expand Up @@ -169,9 +167,7 @@ const ChatPage = () => {
<ChatBubbleOutlineIcon
style={{ marginTop: '20px', color: '#55ce7e' }}
/>
<CopyResourceAttribute
value={chat.output}
/>
<CopyResourceAttribute value={chat.output} />
</Box>
<Box sx={outputChat}>
<Typography>{chat.output}</Typography>
Expand Down

0 comments on commit 03c66dd

Please sign in to comment.