Skip to content

Commit

Permalink
fix-fe: navigate 링크 수정 (#371)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jeongwoo Park <[email protected]>
  • Loading branch information
2 people authored and seongjinme committed Aug 23, 2024
1 parent 59c097e commit f1ee314
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 21 deletions.
15 changes: 9 additions & 6 deletions frontend/src/components/common/CopyToClipboard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import useCopyToClipboard from '@hooks/utils/useCopyToClipboard';
import { HiClipboard, HiClipboardCheck } from 'react-icons/hi';
import { Link } from 'react-router-dom';
import IconButton from '../IconButton';
import S from './style';

Expand All @@ -13,12 +14,14 @@ export default function CopyToClipboard({ url }: CopyLinkClipboardProps) {
return (
<S.Wrapper>
<S.LinkContainer>
<S.Link
href={url}
target="_blank"
rel="noreferrer"
>
{url}
<S.Link>
<Link
to={url}
target="_blank"
rel="noreferrer"
>
{url}
</Link>
</S.Link>
</S.LinkContainer>

Expand Down
16 changes: 9 additions & 7 deletions frontend/src/components/common/CopyToClipboard/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ const LinkContainer = styled.div`
width: 90%;
`;

const Link = styled.a`
${({ theme }) => theme.typography.common.small};
color: ${({ theme }) => theme.colors.link};
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
const Link = styled.span`
a {
${({ theme }) => theme.typography.common.small};
color: ${({ theme }) => theme.colors.link};
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
`;

const S = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function Finish({ postUrl, postId }: FinishProps) {
<S.Container>
<S.Icon>🎉</S.Icon>
<S.Message>공고가 게시됐어요!</S.Message>
<CopyToClipboard url={postUrl} />
<CopyToClipboard url={`https://${postUrl}`} />
<Button
size="sm"
color="white"
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ Sentry.init({
});

async function setPrev() {
// if (process.env.NODE_ENV === 'development') {
// Sentry.getCurrentScope().setLevel('info');
// const worker = await import('@mocks/browser');
// await worker.default.start();
// }
if (process.env.NODE_ENV === 'development') {
Sentry.getCurrentScope().setLevel('info');
const worker = await import('@mocks/browser');
await worker.default.start();
}
if (process.env.NODE_ENV === 'production') {
ReactGA.initialize(process.env.GA_MEASUREMENT_ID);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/mocks/handlers/dashboardHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const dashboardHandlers = [

const responseBody = JSON.stringify({
postId: 1,
postUrl: 'https://www.hihi.hjihihiaeraewraeraewraew.com',
postUrl: 'www.hihi.hjihihiaeraewraeraewraew.com',
});

return new Response(responseBody, {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function Dashboard() {
<S.AppContainer>
<S.Title>{title}</S.Title>

<Tab postUrl={postUrl}>
<Tab postUrl={`https://${postUrl}`}>
{Object.values(DASHBOARD_TAB_MENUS).map((label) => (
<Tab.TabItem
key={label}
Expand Down

0 comments on commit f1ee314

Please sign in to comment.