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

bugfix/icdc 3694 #1195

Open
wants to merge 6 commits into
base: development
Choose a base branch
from
Open
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
1,043 changes: 214 additions & 829 deletions package-lock.json

Large diffs are not rendered by default.

61 changes: 0 additions & 61 deletions src/components/Breadcrumb/BreadcrumbView.jsx

This file was deleted.

31 changes: 31 additions & 0 deletions src/components/Breadcrumb/BreadcrumbView.styled.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import styled from '@emotion/styled';
import { Link } from 'react-router-dom';

export const Container = styled.div({
color: '#5e8ca5',
display: 'flex',
alignItems: 'center',
gap: '8px',
});

export const BreadcrumbNavLink = styled(Link)({
paddingLeft: '2px',
paddingRight: '2px',
textDecoration: 'none',
color: '#0B4E75',
fontFamily: 'Lato',
fontWeight: '700',
fontSize: '12px',
letterSpacing: '0.025em',
});

export const BreadcrumbSpan = styled.span({
paddingLeft: '2px',
paddingRight: '2px',
textDecoration: 'none',
color: '#0B4E75',
fontFamily: 'Lato',
fontWeight: '500',
fontSize: '12px',
letterSpacing: '0.025em',
});
41 changes: 41 additions & 0 deletions src/components/Breadcrumb/BreadcrumbView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react';
import {
BreadcrumbNavLink,
BreadcrumbSpan,
Container,
} from './BreadcrumbView.styled';

export interface BreadcrumbData {
name: string | undefined | null;
to?: string;
isALink: boolean;
}
interface CustomBreadcrumbProps {
data: BreadcrumbData[];
}

const CustomBreadcrumb: React.FC<CustomBreadcrumbProps> = ({ data }) => {
return (
<Container>
{data
.reduce<React.ReactNode[]>((acc, current, index) => {
if (current.isALink && current.to) {
acc.push(
<BreadcrumbNavLink to={current.to}>
{current.name}
</BreadcrumbNavLink>
);
} else {
acc.push(<BreadcrumbSpan>{current.name}</BreadcrumbSpan>);
}
if (index < data.length - 1) {
acc.push(<div style={{ fontSize: '15px' }}>{'>'}</div>);
}
return acc;
}, [])
.map(item => item)}
</Container>
);
};

export default CustomBreadcrumb;
Loading