Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-fe: navigate 링크 수정 #371

Merged
merged 3 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading