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

Feat: Removing resources and newletter from web-release-3 branch #698

Merged
merged 5 commits into from
May 23, 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
92 changes: 0 additions & 92 deletions components/Newsletter.tsx

This file was deleted.

71 changes: 1 addition & 70 deletions components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,7 @@ const getSpecificationPath = [
'/specification-links',
'/specification',
];
const getResourcePath = [
'/resources/books',
'/resources/podcasts',
'/resources/papers',
'/resources/audios',
'/resources/courses',
];
const resourceRoutes = [
{ uri: '/resources/books', label: 'Books' },
{ uri: '/resources/courses', label: 'Courses' },
{ uri: '/resources/videos', label: 'Videos' },
{ uri: '/resources/podcasts', label: 'Podcasts' },
{ uri: '/resources/papers', label: 'Papers' },
];

export const SidebarLayout = ({ children }: { children: React.ReactNode }) => {
const router = useRouter();
const [open, setOpen] = useState(false);
Expand Down Expand Up @@ -263,7 +250,6 @@ export const DocsNav = ({
getStarted: false,
getReference: false,
getSpecification: false,
getResources: false,
});
useEffect(() => {
const pathWtihoutFragment = extractPathWithoutFragment(router.asPath);
Expand All @@ -275,8 +261,6 @@ export const DocsNav = ({
setActive({ ...active, getReference: true });
} else if (getSpecificationPath.includes(pathWtihoutFragment)) {
setActive({ ...active, getSpecification: true });
} else if (getResourcePath.includes(router.asPath)) {
setActive({ ...active, getResources: true });
}
}, [router.asPath]);

Expand All @@ -296,37 +280,28 @@ export const DocsNav = ({
setActive({ ...active, getSpecification: !active.getSpecification });
};

const handleClickResources = () => {
setActive({ ...active, getResources: !active.getResources });
};

const rotate = active.getDocs ? 'rotate(180deg)' : 'rotate(0)';
const rotateG = active.getStarted ? 'rotate(180deg)' : 'rotate(0)';
const rotateR = active.getReference ? 'rotate(180deg)' : 'rotate(0)';
const rotateSpec = active.getSpecification ? 'rotate(180deg)' : 'rotate(0)';
const rotateResources = active.getResources ? 'rotate(180deg)' : 'rotate(0)';

const { theme } = useTheme();

const [learn_icon, setLearn_icon] = useState('');
const [reference_icon, setReference_icon] = useState('');
const [spec_icon, setSpec_icon] = useState('');
const [overview_icon, setOverview_icon] = useState('');
const [resources_icon, setResources_icon] = useState('');

useEffect(() => {
if (theme === 'dark') {
setOverview_icon('/icons/eye-dark.svg');
setLearn_icon('/icons/compass-dark.svg');
setReference_icon('/icons/book-dark.svg');
setSpec_icon('/icons/clipboard-dark.svg');
setResources_icon('/icons/bookshelf-dark.svg');
} else {
setOverview_icon('/icons/eye.svg');
setLearn_icon('/icons/compass.svg');
setReference_icon('/icons/book.svg');
setSpec_icon('/icons/clipboard.svg');
setResources_icon('/icons/bookshelf.svg');
}
}, [theme]);

Expand Down Expand Up @@ -732,50 +707,6 @@ export const DocsNav = ({
</div>
</div>
</div>
{/* Resources */}
<div className='mb-2 bg-slate-200 dark:bg-slate-900 p-2 rounded'>
<div
className='flex justify-between w-full items-center'
onClick={handleClickResources}
>
<div className='flex items-center align-middle'>
<img
src={`${resources_icon}`}
alt='eye icon'
className='mr-2 w-6'
/>
<SegmentHeadline label='Other Resources' />
</div>
<svg
id='arrow'
className='arrow'
style={{
transform: rotateResources,
transition: 'all 0.2s linear',
}}
xmlns='http://www.w3.org/2000/svg'
fill='none'
height='32'
viewBox='0 0 24 24'
width='24'
>
<path
clipRule='evenodd'
d='m16.5303 8.96967c.2929.29289.2929.76777 0 1.06063l-4 4c-.2929.2929-.7677.2929-1.0606 0l-4.00003-4c-.29289-.29286-.29289-.76774 0-1.06063s.76777-.29289 1.06066 0l3.46967 3.46963 3.4697-3.46963c.2929-.29289.7677-.29289 1.0606 0z'
fill='#707070'
fillRule='evenodd'
/>
</svg>
</div>
<div
className={classnames('ml-6', { hidden: !active.getResources })}
id='resources'
>
{resourceRoutes.map(({ uri, label }) => (
<DocLink key={uri} uri={uri} label={label} setOpen={setOpen} />
))}
</div>
</div>
</div>
);
};
Expand Down
Loading
Loading