Skip to content

Commit 8208d67

Browse files
committed
iterate
1 parent 2215f82 commit 8208d67

24 files changed

+269
-191
lines changed

app/App.jsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ const App = () => (
3535
<ThemeProvider>
3636
<TooltipProvider>
3737
<UserProvider>
38-
<InstantSearch
39-
searchClient={searchClient}
40-
indexName={ALGOLIA_INDEXES_NAMES[ENTITY_VIDEO]}
41-
>
42-
<Index indexName={ALGOLIA_INDEXES_NAMES[ENTITY_VIDEO]}>
43-
<Configure hitsPerPage={16} />
44-
</Index>
45-
<Index indexName={ALGOLIA_INDEXES_NAMES[ENTITY_SPEAKER]}>
46-
<Configure hitsPerPage={32} />
47-
</Index>
48-
<Index indexName={ALGOLIA_INDEXES_NAMES[ENTITY_STATEMENT]}>
49-
<Configure hitsPerPage={24} />
50-
</Index>
51-
<CFRouter />
52-
</InstantSearch>
53-
</UserProvider>
54-
</TooltipProvider>
38+
<InstantSearch
39+
searchClient={searchClient}
40+
indexName={ALGOLIA_INDEXES_NAMES[ENTITY_VIDEO]}
41+
>
42+
<Index indexName={ALGOLIA_INDEXES_NAMES[ENTITY_VIDEO]}>
43+
<Configure hitsPerPage={16} />
44+
</Index>
45+
<Index indexName={ALGOLIA_INDEXES_NAMES[ENTITY_SPEAKER]}>
46+
<Configure hitsPerPage={32} />
47+
</Index>
48+
<Index indexName={ALGOLIA_INDEXES_NAMES[ENTITY_STATEMENT]}>
49+
<Configure hitsPerPage={24} />
50+
</Index>
51+
<CFRouter />
52+
</InstantSearch>
53+
</UserProvider>
54+
</TooltipProvider>
5555
</ThemeProvider>
5656
</I18nextProvider>
5757
</ApolloProvider>

app/components/App/Navbar.jsx

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { LogIn, Monitor, Moon, Sun } from 'lucide-react'
2-
import React, { useEffect, useMemo } from 'react'
2+
import React, { useMemo } from 'react'
33
import { useTranslation, withTranslation } from 'react-i18next'
44
import { withResizeDetector } from 'react-resize-detector'
55
import { Link, withRouter } from 'react-router-dom'
@@ -76,27 +76,37 @@ const Navbar = ({ t, loggedInUser, isAuthenticated, loggedInUserLoading, locatio
7676
const loginRedirect = getRedirectUrl()
7777
const { resolvedTheme } = useTheme()
7878
const isDarkMode = resolvedTheme === 'dark'
79-
80-
const notificationsPopupStyle = useMemo(() => ({
81-
zIndex: 9999,
82-
overflow: 'hidden',
83-
backgroundColor: isDarkMode ? 'hsl(0, 0%, 12%)' : '#ffffff',
84-
border: isDarkMode ? '1px solid hsl(0, 0%, 20%)' : '1px solid #d3d3d3',
85-
borderRadius: '5px',
86-
boxShadow: isDarkMode ? 'rgba(0, 0, 0, 0.3) 5px 10px 15px -6px' : 'rgba(150, 150, 150, 0.2) 5px 10px 15px -6px',
87-
width: isMobile ? '95%' : '400px',
88-
}), [isDarkMode, isMobile])
89-
90-
const userMenuPopupStyle = useMemo(() => ({
91-
zIndex: 9999,
92-
overflow: 'hidden',
93-
backgroundColor: isDarkMode ? 'hsl(0, 0%, 12%)' : '#ffffff',
94-
border: isDarkMode ? '1px solid hsl(0, 0%, 20%)' : '1px solid #d3d3d3',
95-
borderRadius: '5px',
96-
boxShadow: isDarkMode ? 'rgba(0, 0, 0, 0.3) 5px 10px 15px -6px' : 'rgba(150, 150, 150, 0.2) 5px 10px 15px -6px',
97-
minWidth: '200px',
98-
}), [isDarkMode])
99-
79+
80+
const notificationsPopupStyle = useMemo(
81+
() => ({
82+
zIndex: 9999,
83+
overflow: 'hidden',
84+
backgroundColor: isDarkMode ? 'hsl(0, 0%, 12%)' : '#ffffff',
85+
border: isDarkMode ? '1px solid hsl(0, 0%, 20%)' : '1px solid #d3d3d3',
86+
borderRadius: '5px',
87+
boxShadow: isDarkMode
88+
? 'rgba(0, 0, 0, 0.3) 5px 10px 15px -6px'
89+
: 'rgba(150, 150, 150, 0.2) 5px 10px 15px -6px',
90+
width: isMobile ? '95%' : '400px',
91+
}),
92+
[isDarkMode, isMobile],
93+
)
94+
95+
const userMenuPopupStyle = useMemo(
96+
() => ({
97+
zIndex: 9999,
98+
overflow: 'hidden',
99+
backgroundColor: isDarkMode ? 'hsl(0, 0%, 12%)' : '#ffffff',
100+
border: isDarkMode ? '1px solid hsl(0, 0%, 20%)' : '1px solid #d3d3d3',
101+
borderRadius: '5px',
102+
boxShadow: isDarkMode
103+
? 'rgba(0, 0, 0, 0.3) 5px 10px 15px -6px'
104+
: 'rgba(150, 150, 150, 0.2) 5px 10px 15px -6px',
105+
minWidth: '200px',
106+
}),
107+
[isDarkMode],
108+
)
109+
100110
return (
101111
<div data-cy="Navbar">
102112
<div className="h-[60px] w-full" />
@@ -174,7 +184,9 @@ const Navbar = ({ t, loggedInUser, isAuthenticated, loggedInUserLoading, locatio
174184
<UserPicture size={USER_PICTURE_LARGE} user={loggedInUser} />
175185
<div className="flex flex-col justify-center">
176186
<UserAppellation user={loggedInUser} withoutActions />
177-
<span className="text-[0.8em] text-[#252525] dark:text-muted-foreground">{loggedInUser.email}</span>
187+
<span className="text-[0.8em] text-[#252525] dark:text-muted-foreground">
188+
{loggedInUser.email}
189+
</span>
178190
</div>
179191
</div>
180192
<InlineThemeSelector />

app/components/App/Sidebar.jsx

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ export default class Sidebar extends React.PureComponent {
9090
)}
9191
>
9292
<div className="flex flex-col flex-grow overflow-y-auto p-4">
93-
<p className={'text-gray-600 dark:text-muted-foreground uppercase text-sm font-semibold mb-2'}>
93+
<p
94+
className={
95+
'text-gray-600 dark:text-muted-foreground uppercase text-sm font-semibold mb-2'
96+
}
97+
>
9498
{t('menu.language')}
9599
</p>
96100
<UserLanguageSelector className={cn('mb-4')} size="small" />
@@ -130,7 +134,10 @@ export default class Sidebar extends React.PureComponent {
130134
>
131135
<Users size="1.2em" className="mr-2" />
132136
{t('menu.forum')}
133-
<LinkExternal size="0.9em" className="text-gray-500 dark:text-muted-foreground hover:text-gray-900 dark:hover:text-foreground ml-2" />
137+
<LinkExternal
138+
size="0.9em"
139+
className="text-gray-500 dark:text-muted-foreground hover:text-gray-900 dark:hover:text-foreground ml-2"
140+
/>
134141
</ExternalLinkNewTab>
135142
<ExternalLinkNewTab
136143
href="https://opencollective.com/captainfact_io"
@@ -140,27 +147,45 @@ export default class Sidebar extends React.PureComponent {
140147
>
141148
<Heart size="1.2em" className="mr-2" />
142149
{t('menu.donation')}&nbsp;
143-
<LinkExternal size="0.9em" className="text-gray-500 dark:text-muted-foreground hover:text-gray-900 dark:hover:text-foreground ml-2" />
150+
<LinkExternal
151+
size="0.9em"
152+
className="text-gray-500 dark:text-muted-foreground hover:text-gray-900 dark:hover:text-foreground ml-2"
153+
/>
144154
</ExternalLinkNewTab>
145155
</ul>
146156
<p className="text-gray-600 dark:text-muted-foreground uppercase text-sm font-semibold mt-3 mb-2">
147157
{t('menu.followus')}
148158
</p>
149159
<div className={'flex space-x-4 px-4'}>
150160
<ExternalLinkNewTab href="https://github.com/CaptainFact">
151-
<Github size="1.5em" className="text-gray-700 dark:text-foreground hover:text-gray-900 dark:hover:text-foreground" />
161+
<Github
162+
size="1.5em"
163+
className="text-gray-700 dark:text-foreground hover:text-gray-900 dark:hover:text-foreground"
164+
/>
152165
</ExternalLinkNewTab>
153166
<ExternalLinkNewTab href="https://discord.captainfact.io">
154-
<Discord size="1.5em" className="text-gray-700 dark:text-foreground hover:text-gray-900 dark:hover:text-foreground" />
167+
<Discord
168+
size="1.5em"
169+
className="text-gray-700 dark:text-foreground hover:text-gray-900 dark:hover:text-foreground"
170+
/>
155171
</ExternalLinkNewTab>
156172
<ExternalLinkNewTab href="https://twitter.com/CaptainFact_io">
157-
<Twitter size="1.5em" className="text-gray-700 dark:text-foreground hover:text-gray-900 dark:hover:text-foreground" />
173+
<Twitter
174+
size="1.5em"
175+
className="text-gray-700 dark:text-foreground hover:text-gray-900 dark:hover:text-foreground"
176+
/>
158177
</ExternalLinkNewTab>
159178
<ExternalLinkNewTab href="https://www.facebook.com/CaptainFact.io">
160-
<Facebook size="1.5em" className="text-gray-700 dark:text-foreground hover:text-gray-900 dark:hover:text-foreground" />
179+
<Facebook
180+
size="1.5em"
181+
className="text-gray-700 dark:text-foreground hover:text-gray-900 dark:hover:text-foreground"
182+
/>
161183
</ExternalLinkNewTab>
162184
<ExternalLinkNewTab href="https://mamot.fr/@CaptainFact">
163-
<Mastodon size="1.5em" className="text-gray-700 dark:text-foreground hover:text-gray-900 dark:hover:text-foreground" />
185+
<Mastodon
186+
size="1.5em"
187+
className="text-gray-700 dark:text-foreground hover:text-gray-900 dark:hover:text-foreground"
188+
/>
164189
</ExternalLinkNewTab>
165190
</div>
166191
</div>

app/components/Help/HelpPageContent.jsx

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,41 @@ class HelpPageContent extends PureComponent {
5454
className="content"
5555
remarkPlugins={[remarkGfm]}
5656
components={{
57-
h1: (props) => <h1 className="text-4xl mb-8 mt-12 text-gray-800 dark:text-foreground font-bold" {...props} />,
58-
h2: (props) => <h2 className="text-3xl font-bold mt-8 mb-6 text-gray-700 dark:text-foreground" {...props} />,
59-
h3: (props) => <h3 className="text-2xl font-bold mb-4 mt-6 text-gray-600 dark:text-foreground" {...props} />,
57+
h1: (props) => (
58+
<h1
59+
className="text-4xl mb-8 mt-12 text-gray-800 dark:text-foreground font-bold"
60+
{...props}
61+
/>
62+
),
63+
h2: (props) => (
64+
<h2
65+
className="text-3xl font-bold mt-8 mb-6 text-gray-700 dark:text-foreground"
66+
{...props}
67+
/>
68+
),
69+
h3: (props) => (
70+
<h3
71+
className="text-2xl font-bold mb-4 mt-6 text-gray-600 dark:text-foreground"
72+
{...props}
73+
/>
74+
),
6075
h4: (props) => (
61-
<h4 className="text-xl mb-4 mt-6 text-gray-600 dark:text-foreground font-semibold" {...props} />
76+
<h4
77+
className="text-xl mb-4 mt-6 text-gray-600 dark:text-foreground font-semibold"
78+
{...props}
79+
/>
80+
),
81+
p: (props) => (
82+
<p
83+
className="text-lg leading-relaxed text-gray-600 dark:text-foreground my-6"
84+
{...props}
85+
/>
6286
),
63-
p: (props) => <p className="text-lg leading-relaxed text-gray-600 dark:text-foreground my-6" {...props} />,
6487
ul: (props) => (
65-
<ul className="list-disc list-outside ml-6 mb-6 space-y-2 text-gray-600 dark:text-foreground" {...props} />
88+
<ul
89+
className="list-disc list-outside ml-6 mb-6 space-y-2 text-gray-600 dark:text-foreground"
90+
{...props}
91+
/>
6692
),
6793
ol: (props) => (
6894
<ol
@@ -115,7 +141,10 @@ class HelpPageContent extends PureComponent {
115141
),
116142
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
117143
thead: ({ node, ...props }) => (
118-
<thead className="bg-gray-50 dark:bg-accent border-b border-gray-200 dark:border-border" {...props} />
144+
<thead
145+
className="bg-gray-50 dark:bg-accent border-b border-gray-200 dark:border-border"
146+
{...props}
147+
/>
119148
),
120149
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
121150
tr: ({ node, ...props }) => (
@@ -126,10 +155,15 @@ class HelpPageContent extends PureComponent {
126155
),
127156
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
128157
th: ({ node, ...props }) => (
129-
<th className="p-3 font-medium text-left text-gray-700 dark:text-foreground" {...props} />
158+
<th
159+
className="p-3 font-medium text-left text-gray-700 dark:text-foreground"
160+
{...props}
161+
/>
130162
),
131163
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
132-
td: ({ node, ...props }) => <td className="p-3 text-gray-600 dark:text-foreground" {...props} />,
164+
td: ({ node, ...props }) => (
165+
<td className="p-3 text-gray-600 dark:text-foreground" {...props} />
166+
),
133167
}}
134168
>
135169
{this.props.markdownContent}

app/components/Home/Home.jsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ const Home = () => {
4242
</strong>
4343
</h1>
4444
<br />
45-
<h2 className="text-2xl sm:text-3xl font-semibold mb-1 text-foreground">{t('titleCF')}</h2>
45+
<h2 className="text-2xl sm:text-3xl font-semibold mb-1 text-foreground">
46+
{t('titleCF')}
47+
</h2>
4648
<h2 className="text-xl font-light mb-2 text-foreground">
4749
<Trans i18nKey="home:presentationTitle">
4850
To train a critical mind, improve the quality of information and decision-making.
@@ -62,7 +64,9 @@ const Home = () => {
6264
)}
6365
</div>
6466
<div className="w-full md:w-5/12">
65-
<p className="font-bold mb-4 min-h-[72px] text-foreground">{t('presentationTextButton2')}</p>
67+
<p className="font-bold mb-4 min-h-[72px] text-foreground">
68+
{t('presentationTextButton2')}
69+
</p>
6670
{!isAuthenticated && (
6771
<Link to="/signup">
6872
<Button className="h-auto">
@@ -127,7 +131,9 @@ const Home = () => {
127131
</div>
128132
<div className="w-full md:w-6/12 px-4">
129133
<div className="md:pl-8">
130-
<h2 className="text-3xl font-semibold mb-4 text-foreground">{t('example1Title1')}</h2>
134+
<h2 className="text-3xl font-semibold mb-4 text-foreground">
135+
{t('example1Title1')}
136+
</h2>
131137
<h2 className="text-2xl font-light mb-4 text-foreground">{t('example1Title2')}</h2>
132138
<p className="mb-6 text-foreground">{t('example1Text')}</p>
133139
<Link to="/extension">
@@ -144,7 +150,9 @@ const Home = () => {
144150
<div className="flex flex-wrap -mx-4 mb-16">
145151
<div className="w-full md:w-6/12 px-4 mb-8 md:mb-0">
146152
<div className="md:pr-8">
147-
<h2 className="text-3xl font-semibold mb-4 text-foreground">{t('example2Title1')}</h2>
153+
<h2 className="text-3xl font-semibold mb-4 text-foreground">
154+
{t('example2Title1')}
155+
</h2>
148156
<h2 className="text-2xl font-light mb-4 text-foreground">{t('example2Title2')}</h2>
149157
<p className="mb-6 text-foreground">{t('example2Text')}</p>
150158
<Link to="/signup">
@@ -167,7 +175,9 @@ const Home = () => {
167175
</div>
168176
<div className="w-full md:w-6/12 px-4">
169177
<div className="md:pl-8">
170-
<h2 className="text-3xl font-semibold mb-4 text-foreground">{t('example3Title1')}</h2>
178+
<h2 className="text-3xl font-semibold mb-4 text-foreground">
179+
{t('example3Title1')}
180+
</h2>
171181
<h2 className="text-2xl font-light mb-4 text-foreground">{t('example3Title2')}</h2>
172182
<p className="mb-6 text-foreground">{t('example3Text')}</p>
173183
<ExternalLinkNewTab href="https://github.com/CaptainFact/captain-fact/wiki/Les-partenariats-entre-les-chaînes-Youtube-et-CaptainFact.io">

app/components/Moderation/Moderation.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ export default class Moderation extends React.PureComponent {
6060
<div className="text-center mb-8">
6161
<p className="mb-2 dark:text-foreground">{t('helpText1')}</p>
6262
<p className="mb-4 dark:text-foreground">{t('helpText2')}</p>
63-
<Link className="font-bold hover:underline dark:text-foreground dark:hover:text-primary" to="/help/moderation">
63+
<Link
64+
className="font-bold hover:underline dark:text-foreground dark:hover:text-primary"
65+
to="/help/moderation"
66+
>
6467
{t('learnMore')}
6568
</Link>
6669
</div>

app/components/Search/SearchPage.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ const SearchPage = ({ t, refine, match, location }) => {
4949
Search results for: <strong>{{ query: term || '…' }}</strong>
5050
</Trans>
5151
</h2>
52-
<p className="text-[#8c8c8c] dark:text-muted-foreground text-sm mt-1 italic">Powered by Algolia</p>
52+
<p className="text-[#8c8c8c] dark:text-muted-foreground text-sm mt-1 italic">
53+
Powered by Algolia
54+
</p>
5355
</div>
5456
<div className="mt-8">
5557
<ul className="flex border-b border-[#dbdbdb] dark:border-border px-4 lg:px-10 flex-wrap">

app/components/Speakers/AddSpeakerForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { SPEAKER_NAME_LENGTH } from '../../constants'
88
import { cleanStr } from '../../lib/clean_str'
99
import { checkLength } from '../../lib/form_validators'
1010
import capitalizeName from '../../lib/name_formatter'
11-
import { ReactiveAsyncCreatable, ReactSelectStyles, ReactSelectTheme } from '../../lib/react_select_theme'
11+
import { ReactiveAsyncCreatable, ReactSelectTheme } from '../../lib/react_select_theme'
1212
import { addSpeaker } from '../../state/video_debate/effects'
1313

1414
@connect(null, { addSpeaker })

0 commit comments

Comments
 (0)