diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-15 22:45:57 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-15 22:51:30 +0100 |
| commit | aa1ca65e7c9807c6d6020e39166536297fe1cdae (patch) | |
| tree | 2648da350fec3b71ab7f575d63e4c63ba08248b1 /src/pages | |
| parent | 16dbb4742264edac82fa6bb8e461259d097f4437 (diff) | |
chore: update sidebar and widgets styles
I'm now using a widget that can be expanded/collapsed. It also allows
me to handle more effectively widgets overflow and to avoid styles
repetitions.
However, with stylelint rule "no-descending-specificity", I'm not sure
if the stylesheets are really logical... Maybe I should deactivate this
rule.
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/article/[slug].tsx | 9 | ||||
| -rw-r--r-- | src/pages/blog/index.tsx | 4 | ||||
| -rw-r--r-- | src/pages/contact.tsx | 4 | ||||
| -rw-r--r-- | src/pages/cv.tsx | 9 | ||||
| -rw-r--r-- | src/pages/mentions-legales.tsx | 7 | ||||
| -rw-r--r-- | src/pages/recherche/index.tsx | 4 | ||||
| -rw-r--r-- | src/pages/sujet/[slug].tsx | 12 | ||||
| -rw-r--r-- | src/pages/thematique/[slug].tsx | 12 |
8 files changed, 30 insertions, 31 deletions
diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index fb79b41..509be4f 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -3,7 +3,6 @@ import CommentsList from '@components/CommentsList/CommentsList'; import { getLayout } from '@components/Layouts/Layout'; import PostFooter from '@components/PostFooter/PostFooter'; import PostHeader from '@components/PostHeader/PostHeader'; -import ToC from '@components/ToC/ToC'; import { config } from '@config/website'; import { getAllPostsSlug, getPostBySlug } from '@services/graphql/queries'; import { NextPageWithLayout } from '@ts/types/app'; @@ -17,7 +16,7 @@ import Prism from 'prismjs'; import { ParsedUrlQuery } from 'querystring'; import { useEffect } from 'react'; import styles from '@styles/pages/Page.module.scss'; -import { Sharing } from '@components/Widget'; +import { Sharing, ToC } from '@components/Widgets'; import Sidebar from '@components/Sidebar/Sidebar'; const SingleArticle: NextPageWithLayout<ArticleProps> = ({ post }) => { @@ -60,15 +59,15 @@ const SingleArticle: NextPageWithLayout<ArticleProps> = ({ post }) => { </Head> <article className={styles.article}> <PostHeader intro={intro} meta={meta} title={title} /> - <aside className={styles.toc}> + <Sidebar position="left"> <ToC /> - </aside> + </Sidebar> <div className={styles.body} dangerouslySetInnerHTML={{ __html: content }} ></div> <PostFooter subjects={subjects} /> - <Sidebar> + <Sidebar position="right"> <Sharing title={title} excerpt={intro} /> </Sidebar> <section className={styles.comments}> diff --git a/src/pages/blog/index.tsx b/src/pages/blog/index.tsx index e0d35cd..b20b647 100644 --- a/src/pages/blog/index.tsx +++ b/src/pages/blog/index.tsx @@ -12,7 +12,7 @@ import useSWRInfinite from 'swr/infinite'; import { Button } from '@components/Buttons'; import { getPublishedPosts } from '@services/graphql/queries'; import PostHeader from '@components/PostHeader/PostHeader'; -import { ThematicsList, TopicsList } from '@components/Widget'; +import { ThematicsList, TopicsList } from '@components/Widgets'; import Sidebar from '@components/Sidebar/Sidebar'; import styles from '@styles/pages/Page.module.scss'; import { useRef } from 'react'; @@ -74,7 +74,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ fallback }) => { >{t`Load more?`}</Button> )} </div> - <Sidebar> + <Sidebar position="right" title={t`Filter by`}> <ThematicsList title={t`Thematics`} /> <TopicsList title={t`Topics`} /> </Sidebar> diff --git a/src/pages/contact.tsx b/src/pages/contact.tsx index 5e6d138..bafa5e9 100644 --- a/src/pages/contact.tsx +++ b/src/pages/contact.tsx @@ -11,7 +11,7 @@ import Head from 'next/head'; import { FormEvent, useState } from 'react'; import PostHeader from '@components/PostHeader/PostHeader'; import styles from '@styles/pages/Page.module.scss'; -import { SocialMedia } from '@components/Widget'; +import { SocialMedia } from '@components/Widgets'; import Sidebar from '@components/Sidebar/Sidebar'; const ContactPage: NextPageWithLayout = () => { @@ -113,7 +113,7 @@ const ContactPage: NextPageWithLayout = () => { </FormItem> </Form> </div> - <Sidebar> + <Sidebar position="right"> <SocialMedia title={t`Find me elsewhere`} github={true} diff --git a/src/pages/cv.tsx b/src/pages/cv.tsx index c771bb2..01eab4c 100644 --- a/src/pages/cv.tsx +++ b/src/pages/cv.tsx @@ -1,5 +1,4 @@ import { getLayout } from '@components/Layouts/Layout'; -import ToC from '@components/ToC/ToC'; import { seo } from '@config/seo'; import { NextPageWithLayout } from '@ts/types/app'; import { loadTranslation } from '@utils/helpers/i18n'; @@ -9,7 +8,7 @@ import CVContent, { intro, meta, pdf, image } from '@content/pages/cv.mdx'; import PostHeader from '@components/PostHeader/PostHeader'; import { ArticleMeta } from '@ts/types/articles'; import styles from '@styles/pages/Page.module.scss'; -import { CVPreview, SocialMedia } from '@components/Widget'; +import { CVPreview, SocialMedia, ToC } from '@components/Widgets'; import { t } from '@lingui/macro'; import Sidebar from '@components/Sidebar/Sidebar'; @@ -33,13 +32,13 @@ const CV: NextPageWithLayout = () => { className={`${styles.article} ${styles['article--no-comments']}`} > <PostHeader intro={intro} meta={pageMeta} title={meta.title} /> - <aside className={styles.toc}> + <Sidebar position="left"> <ToC /> - </aside> + </Sidebar> <div className={styles.body}> <CVContent /> </div> - <Sidebar> + <Sidebar position="right"> <CVPreview title={t`Other formats`} imgSrc={image} pdf={pdf} /> <SocialMedia title={t`Open-source projects`} diff --git a/src/pages/mentions-legales.tsx b/src/pages/mentions-legales.tsx index ea98e20..fcaef06 100644 --- a/src/pages/mentions-legales.tsx +++ b/src/pages/mentions-legales.tsx @@ -1,5 +1,4 @@ import { getLayout } from '@components/Layouts/Layout'; -import ToC from '@components/ToC/ToC'; import { seo } from '@config/seo'; import { NextPageWithLayout } from '@ts/types/app'; import { loadTranslation } from '@utils/helpers/i18n'; @@ -12,6 +11,8 @@ import LegalNoticeContent, { import PostHeader from '@components/PostHeader/PostHeader'; import { ArticleMeta } from '@ts/types/articles'; import styles from '@styles/pages/Page.module.scss'; +import { ToC } from '@components/Widgets'; +import Sidebar from '@components/Sidebar/Sidebar'; const LegalNotice: NextPageWithLayout = () => { const dates = { @@ -33,9 +34,9 @@ const LegalNotice: NextPageWithLayout = () => { className={`${styles.article} ${styles['article--no-comments']}`} > <PostHeader intro={intro} meta={pageMeta} title={meta.title} /> - <aside className={styles.toc}> + <Sidebar position="left"> <ToC /> - </aside> + </Sidebar> <div className={styles.body}> <LegalNoticeContent /> </div> diff --git a/src/pages/recherche/index.tsx b/src/pages/recherche/index.tsx index 57f40e2..c45f9f0 100644 --- a/src/pages/recherche/index.tsx +++ b/src/pages/recherche/index.tsx @@ -14,7 +14,7 @@ import { useRouter } from 'next/router'; import { useEffect, useRef, useState } from 'react'; import useSWRInfinite from 'swr/infinite'; import Sidebar from '@components/Sidebar/Sidebar'; -import { ThematicsList, TopicsList } from '@components/Widget'; +import { ThematicsList, TopicsList } from '@components/Widgets'; import styles from '@styles/pages/Page.module.scss'; const Search: NextPageWithLayout = () => { @@ -97,7 +97,7 @@ const Search: NextPageWithLayout = () => { >{t`Load more?`}</Button> )} </div> - <Sidebar> + <Sidebar position="right"> <ThematicsList title={t`Thematics`} /> <TopicsList title={t`Topics`} /> </Sidebar> diff --git a/src/pages/sujet/[slug].tsx b/src/pages/sujet/[slug].tsx index a7adf89..b373041 100644 --- a/src/pages/sujet/[slug].tsx +++ b/src/pages/sujet/[slug].tsx @@ -13,10 +13,10 @@ import { } from '@services/graphql/queries'; import PostHeader from '@components/PostHeader/PostHeader'; import { ArticleMeta } from '@ts/types/articles'; -import ToC from '@components/ToC/ToC'; -import { RelatedThematics, TopicsList } from '@components/Widget'; +import { RelatedThematics, ToC, TopicsList } from '@components/Widgets'; import { useRef } from 'react'; import Head from 'next/head'; +import Sidebar from '@components/Sidebar/Sidebar'; const Subject: NextPageWithLayout<SubjectProps> = ({ subject }) => { const relatedThematics = useRef<ThematicPreview[]>([]); @@ -64,9 +64,9 @@ const Subject: NextPageWithLayout<SubjectProps> = ({ subject }) => { meta={meta} title={subject.title} /> - <aside className={styles.toc}> + <Sidebar position="left"> <ToC /> - </aside> + </Sidebar> <div className={styles.body}> <div dangerouslySetInnerHTML={{ __html: subject.content }}></div> {subject.posts.length > 0 && ( @@ -76,10 +76,10 @@ const Subject: NextPageWithLayout<SubjectProps> = ({ subject }) => { </section> )} </div> - <aside className={`${styles.aside} ${styles['aside--overflow']}`}> + <Sidebar position="right"> <RelatedThematics thematics={relatedThematics.current} /> <TopicsList title={t`Other topics`} /> - </aside> + </Sidebar> </article> </> ); diff --git a/src/pages/thematique/[slug].tsx b/src/pages/thematique/[slug].tsx index f23ad5b..4eee656 100644 --- a/src/pages/thematique/[slug].tsx +++ b/src/pages/thematique/[slug].tsx @@ -12,11 +12,11 @@ import { getThematicBySlug, } from '@services/graphql/queries'; import PostHeader from '@components/PostHeader/PostHeader'; -import ToC from '@components/ToC/ToC'; -import { RelatedTopics, ThematicsList } from '@components/Widget'; +import { RelatedTopics, ThematicsList, ToC } from '@components/Widgets'; import { useRef } from 'react'; import { ArticleMeta } from '@ts/types/articles'; import Head from 'next/head'; +import Sidebar from '@components/Sidebar/Sidebar'; const Thematic: NextPageWithLayout<ThematicProps> = ({ thematic }) => { const relatedSubjects = useRef<SubjectPreview[]>([]); @@ -58,9 +58,9 @@ const Thematic: NextPageWithLayout<ThematicProps> = ({ thematic }) => { className={`${styles.article} ${styles['article--no-comments']}`} > <PostHeader intro={thematic.intro} meta={meta} title={thematic.title} /> - <aside className={styles.toc}> + <Sidebar position="left"> <ToC /> - </aside> + </Sidebar> <div className={styles.body}> <div dangerouslySetInnerHTML={{ __html: thematic.content }}></div> {thematic.posts.length > 0 && ( @@ -70,10 +70,10 @@ const Thematic: NextPageWithLayout<ThematicProps> = ({ thematic }) => { </section> )} </div> - <aside className={`${styles.aside} ${styles['aside--overflow']}`}> + <Sidebar position="right"> <RelatedTopics topics={relatedSubjects.current} /> <ThematicsList title={t`Other thematics`} /> - </aside> + </Sidebar> </article> </> ); |
