From adf78360403fbf53df7f1edb8f636215d4f4d9fa Mon Sep 17 00:00:00 2001 From: Rahul Harpal Date: Tue, 23 Jul 2024 19:29:35 +0530 Subject: [PATCH 1/6] chore: Update dark theme logos styling --- docs/src/components/HomepageFeatures/index.tsx | 7 ++++++- docs/src/components/HomepageFeatures/styles.module.css | 4 ++++ docs/src/components/HomepageSponsored/index.tsx | 7 ++++++- docs/src/components/HomepageSponsored/styles.module.css | 4 ++++ docs/static/img/Algolia-logo.svg | 2 +- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/src/components/HomepageFeatures/index.tsx b/docs/src/components/HomepageFeatures/index.tsx index 6878007c2..c9dbb80a9 100644 --- a/docs/src/components/HomepageFeatures/index.tsx +++ b/docs/src/components/HomepageFeatures/index.tsx @@ -42,10 +42,15 @@ const FeatureList: FeatureItem[] = [ ] function Feature({ title, Svg, description }: FeatureItem) { + var classVar = styles.featureSvg; + if(Svg === require('@site/static/img/github.svg').default) + { + classVar = styles.featureSvg +" "+ styles.githubLogo; + } return (
- +

{title}

diff --git a/docs/src/components/HomepageFeatures/styles.module.css b/docs/src/components/HomepageFeatures/styles.module.css index b248eb2e5..04a160d07 100644 --- a/docs/src/components/HomepageFeatures/styles.module.css +++ b/docs/src/components/HomepageFeatures/styles.module.css @@ -9,3 +9,7 @@ height: 200px; width: 200px; } + +html[data-theme='dark'] .githubLogo { + fill: #fff; +} \ No newline at end of file diff --git a/docs/src/components/HomepageSponsored/index.tsx b/docs/src/components/HomepageSponsored/index.tsx index 0ba14b1c9..54dcedba2 100644 --- a/docs/src/components/HomepageSponsored/index.tsx +++ b/docs/src/components/HomepageSponsored/index.tsx @@ -51,11 +51,16 @@ const SponsorList: SponsorItem[] = [ ] function Feature({ title, Svg, link }: FeatureItem) { + var classVar = styles.featureSvg; + if(Svg === require('@site/static/img/Algolia-logo.svg').default) + { + classVar = styles.featureSvg +" "+ styles.AlgoliaLogo; + } return (
- +
diff --git a/docs/src/components/HomepageSponsored/styles.module.css b/docs/src/components/HomepageSponsored/styles.module.css index c5af04aeb..efc24c3a9 100644 --- a/docs/src/components/HomepageSponsored/styles.module.css +++ b/docs/src/components/HomepageSponsored/styles.module.css @@ -29,3 +29,7 @@ width: 100%; } } + +html[data-theme='dark'] .AlgoliaLogo{ + fill: #fff; +} \ No newline at end of file diff --git a/docs/static/img/Algolia-logo.svg b/docs/static/img/Algolia-logo.svg index 48d492a6a..31b645700 100644 --- a/docs/static/img/Algolia-logo.svg +++ b/docs/static/img/Algolia-logo.svg @@ -1 +1 @@ - + From 2bad04f8d10354051fd1a78962aef35cf90b9d48 Mon Sep 17 00:00:00 2001 From: Rahul Harpal <51887323+rahulharpal1603@users.noreply.github.com> Date: Tue, 23 Jul 2024 22:44:44 +0530 Subject: [PATCH 2/6] replaced var with let --- docs/src/components/HomepageFeatures/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/components/HomepageFeatures/index.tsx b/docs/src/components/HomepageFeatures/index.tsx index c9dbb80a9..0fcb46b85 100644 --- a/docs/src/components/HomepageFeatures/index.tsx +++ b/docs/src/components/HomepageFeatures/index.tsx @@ -42,7 +42,7 @@ const FeatureList: FeatureItem[] = [ ] function Feature({ title, Svg, description }: FeatureItem) { - var classVar = styles.featureSvg; + let classVar = styles.featureSvg; if(Svg === require('@site/static/img/github.svg').default) { classVar = styles.featureSvg +" "+ styles.githubLogo; From 9db68380e8ca971a8b1ea87741e15611abb9a433 Mon Sep 17 00:00:00 2001 From: Rahul Harpal <51887323+rahulharpal1603@users.noreply.github.com> Date: Tue, 23 Jul 2024 22:45:27 +0530 Subject: [PATCH 3/6] Replaced var with let - 2 --- docs/src/components/HomepageSponsored/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/components/HomepageSponsored/index.tsx b/docs/src/components/HomepageSponsored/index.tsx index 54dcedba2..10c69dda2 100644 --- a/docs/src/components/HomepageSponsored/index.tsx +++ b/docs/src/components/HomepageSponsored/index.tsx @@ -51,7 +51,7 @@ const SponsorList: SponsorItem[] = [ ] function Feature({ title, Svg, link }: FeatureItem) { - var classVar = styles.featureSvg; + let classVar = styles.featureSvg; if(Svg === require('@site/static/img/Algolia-logo.svg').default) { classVar = styles.featureSvg +" "+ styles.AlgoliaLogo; From 9de0343654cda1e8f3a1b440d668eed83e168dc0 Mon Sep 17 00:00:00 2001 From: Rahul Harpal <51887323+rahulharpal1603@users.noreply.github.com> Date: Wed, 24 Jul 2024 20:00:06 +0530 Subject: [PATCH 4/6] Applied suggestions from code review Co-authored-by: Gabriel Jablonski --- docs/src/components/HomepageFeatures/index.tsx | 10 +++++----- docs/src/components/HomepageFeatures/styles.module.css | 2 +- docs/src/components/HomepageSponsored/index.tsx | 10 +++++----- .../src/components/HomepageSponsored/styles.module.css | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/src/components/HomepageFeatures/index.tsx b/docs/src/components/HomepageFeatures/index.tsx index 0fcb46b85..c32114a3f 100644 --- a/docs/src/components/HomepageFeatures/index.tsx +++ b/docs/src/components/HomepageFeatures/index.tsx @@ -42,15 +42,15 @@ const FeatureList: FeatureItem[] = [ ] function Feature({ title, Svg, description }: FeatureItem) { - let classVar = styles.featureSvg; - if(Svg === require('@site/static/img/github.svg').default) - { - classVar = styles.featureSvg +" "+ styles.githubLogo; + let svgClassName = styles.featureSvg + if (Svg === require('@site/static/img/github.svg').default) { + svgClassName = `${styles.featureSvg} ${styles.githubLogo}` } + return (
- +

{title}

diff --git a/docs/src/components/HomepageFeatures/styles.module.css b/docs/src/components/HomepageFeatures/styles.module.css index 04a160d07..f2d86345a 100644 --- a/docs/src/components/HomepageFeatures/styles.module.css +++ b/docs/src/components/HomepageFeatures/styles.module.css @@ -12,4 +12,4 @@ html[data-theme='dark'] .githubLogo { fill: #fff; -} \ No newline at end of file +} diff --git a/docs/src/components/HomepageSponsored/index.tsx b/docs/src/components/HomepageSponsored/index.tsx index 10c69dda2..fcdfee716 100644 --- a/docs/src/components/HomepageSponsored/index.tsx +++ b/docs/src/components/HomepageSponsored/index.tsx @@ -51,16 +51,16 @@ const SponsorList: SponsorItem[] = [ ] function Feature({ title, Svg, link }: FeatureItem) { - let classVar = styles.featureSvg; - if(Svg === require('@site/static/img/Algolia-logo.svg').default) - { - classVar = styles.featureSvg +" "+ styles.AlgoliaLogo; + let svgClassName = styles.featureSvg + if (Svg === require('@site/static/img/Algolia-logo.svg').default) { + svgClassName = `${styles.featureSvg} ${styles.AlgoliaLogo}` } + return ( diff --git a/docs/src/components/HomepageSponsored/styles.module.css b/docs/src/components/HomepageSponsored/styles.module.css index efc24c3a9..dd70f3ab2 100644 --- a/docs/src/components/HomepageSponsored/styles.module.css +++ b/docs/src/components/HomepageSponsored/styles.module.css @@ -32,4 +32,4 @@ html[data-theme='dark'] .AlgoliaLogo{ fill: #fff; -} \ No newline at end of file +} From 8e9115c167d2da8e41b2757ab7dc4dd188dd709a Mon Sep 17 00:00:00 2001 From: Rahul Harpal Date: Wed, 24 Jul 2024 21:28:13 +0530 Subject: [PATCH 5/6] changed in approach. added a new key in Svg component. --- docs/src/components/HomepageFeatures/index.tsx | 17 ++++++++++------- .../HomepageFeatures/styles.module.css | 2 +- docs/src/components/HomepageSponsored/index.tsx | 16 +++++++++------- .../HomepageSponsored/styles.module.css | 2 +- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/docs/src/components/HomepageFeatures/index.tsx b/docs/src/components/HomepageFeatures/index.tsx index c32114a3f..aec158ce4 100644 --- a/docs/src/components/HomepageFeatures/index.tsx +++ b/docs/src/components/HomepageFeatures/index.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/require-default-props */ /* eslint-disable import/no-unresolved */ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable global-require */ @@ -9,6 +10,7 @@ type FeatureItem = { title: string Svg: React.ComponentType> description: JSX.Element + allowsDarkMode?: boolean } const FeatureList: FeatureItem[] = [ @@ -28,6 +30,7 @@ const FeatureList: FeatureItem[] = [ community to always try to improve ReactTooltip. ), + allowsDarkMode: true, }, { title: 'Focus on What Matters', @@ -41,16 +44,16 @@ const FeatureList: FeatureItem[] = [ }, ] -function Feature({ title, Svg, description }: FeatureItem) { - let svgClassName = styles.featureSvg - if (Svg === require('@site/static/img/github.svg').default) { - svgClassName = `${styles.featureSvg} ${styles.githubLogo}` - } - +function Feature({ title, Svg, description,allowsDarkMode }: FeatureItem) { return (
- +

{title}

diff --git a/docs/src/components/HomepageFeatures/styles.module.css b/docs/src/components/HomepageFeatures/styles.module.css index f2d86345a..a7268eded 100644 --- a/docs/src/components/HomepageFeatures/styles.module.css +++ b/docs/src/components/HomepageFeatures/styles.module.css @@ -10,6 +10,6 @@ width: 200px; } -html[data-theme='dark'] .githubLogo { +html[data-theme='dark'] .svgDarkMode { fill: #fff; } diff --git a/docs/src/components/HomepageSponsored/index.tsx b/docs/src/components/HomepageSponsored/index.tsx index fcdfee716..81a1f36bc 100644 --- a/docs/src/components/HomepageSponsored/index.tsx +++ b/docs/src/components/HomepageSponsored/index.tsx @@ -14,6 +14,7 @@ type FeatureItem = { // eslint-disable-next-line react/no-unused-prop-types eventTitle?: string link: string + allowsDarkMode?: boolean } type SponsorItem = FeatureItem & { @@ -30,6 +31,7 @@ const FeatureList: FeatureItem[] = [ title: 'Algolia', Svg: require('@site/static/img/Algolia-logo.svg').default, link: 'https://docsearch.algolia.com/', + allowsDarkMode: true, }, ] @@ -50,17 +52,17 @@ const SponsorList: SponsorItem[] = [ // }, ] -function Feature({ title, Svg, link }: FeatureItem) { - let svgClassName = styles.featureSvg - if (Svg === require('@site/static/img/Algolia-logo.svg').default) { - svgClassName = `${styles.featureSvg} ${styles.AlgoliaLogo}` - } - +function Feature({ title, Svg, link,allowsDarkMode}: FeatureItem) { return ( diff --git a/docs/src/components/HomepageSponsored/styles.module.css b/docs/src/components/HomepageSponsored/styles.module.css index dd70f3ab2..512e506c1 100644 --- a/docs/src/components/HomepageSponsored/styles.module.css +++ b/docs/src/components/HomepageSponsored/styles.module.css @@ -30,6 +30,6 @@ } } -html[data-theme='dark'] .AlgoliaLogo{ +html[data-theme='dark'] .svgDarkMode { fill: #fff; } From 8053b9e969fd45e5a1742963f15c466bf6e91db0 Mon Sep 17 00:00:00 2001 From: Rahul Harpal Date: Wed, 24 Jul 2024 22:39:28 +0530 Subject: [PATCH 6/6] ran prettier --- docs/src/components/AdsContainer/styles.css | 2 +- docs/src/components/BannerSponsor/styles.css | 2 +- docs/src/components/HomepageFeatures/index.tsx | 8 ++++---- docs/src/components/HomepageSponsored/index.tsx | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/src/components/AdsContainer/styles.css b/docs/src/components/AdsContainer/styles.css index 23f36db4b..17836b0f2 100644 --- a/docs/src/components/AdsContainer/styles.css +++ b/docs/src/components/AdsContainer/styles.css @@ -11,4 +11,4 @@ width: 100%; max-width: 341px; } -} \ No newline at end of file +} diff --git a/docs/src/components/BannerSponsor/styles.css b/docs/src/components/BannerSponsor/styles.css index dfb66ce71..9323ab5c3 100644 --- a/docs/src/components/BannerSponsor/styles.css +++ b/docs/src/components/BannerSponsor/styles.css @@ -18,4 +18,4 @@ .sponsor-banner-silver { max-width: 163px; -} \ No newline at end of file +} diff --git a/docs/src/components/HomepageFeatures/index.tsx b/docs/src/components/HomepageFeatures/index.tsx index aec158ce4..70caddc8a 100644 --- a/docs/src/components/HomepageFeatures/index.tsx +++ b/docs/src/components/HomepageFeatures/index.tsx @@ -44,16 +44,16 @@ const FeatureList: FeatureItem[] = [ }, ] -function Feature({ title, Svg, description,allowsDarkMode }: FeatureItem) { +function Feature({ title, Svg, description, allowsDarkMode }: FeatureItem) { return (
+ })} + role="img" + />

{title}

diff --git a/docs/src/components/HomepageSponsored/index.tsx b/docs/src/components/HomepageSponsored/index.tsx index 81a1f36bc..184acd6b9 100644 --- a/docs/src/components/HomepageSponsored/index.tsx +++ b/docs/src/components/HomepageSponsored/index.tsx @@ -52,16 +52,16 @@ const SponsorList: SponsorItem[] = [ // }, ] -function Feature({ title, Svg, link,allowsDarkMode}: FeatureItem) { +function Feature({ title, Svg, link, allowsDarkMode }: FeatureItem) { return (