Skip to content

Commit

Permalink
Feat: Removing resources and newletter from web-release-3 branch (#698)
Browse files Browse the repository at this point in the history
* removing newsletter

* removing resources

* removing resources.yml file

* removing resources from welcomee page

---------

Co-authored-by: Benjamin Granados <40007659+benjagm@users.noreply.github.com>
  • Loading branch information
DhairyaMajmudar and benjagm committed May 23, 2024
1 parent d8ef58c commit 3991da0
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 747 deletions.
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

0 comments on commit 3991da0

Please sign in to comment.