diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/auth/Invite.tsx | 8 | ||||
-rw-r--r-- | src/components/services/content/ServiceView.tsx | 44 | ||||
-rw-r--r-- | src/components/settings/navigation/SettingsNavigation.tsx | 6 | ||||
-rw-r--r-- | src/components/settings/services/ServiceItem.tsx | 2 | ||||
-rw-r--r-- | src/components/ui/Loader.tsx | 2 | ||||
-rw-r--r-- | src/components/ui/Slider.tsx | 2 | ||||
-rw-r--r-- | src/components/ui/button/index.tsx | 32 | ||||
-rw-r--r-- | src/components/ui/imageUpload/index.tsx | 2 | ||||
-rw-r--r-- | src/components/ui/select/index.tsx | 16 |
9 files changed, 58 insertions, 56 deletions
diff --git a/src/components/auth/Invite.tsx b/src/components/auth/Invite.tsx index 4ab5157a8..cebef9365 100644 --- a/src/components/auth/Invite.tsx +++ b/src/components/auth/Invite.tsx | |||
@@ -192,7 +192,7 @@ class Invite extends Component<IProps, IState> { | |||
192 | return ( | 192 | return ( |
193 | <div | 193 | <div |
194 | className={ | 194 | className={ |
195 | !embed ? 'auth__container auth__container--signup' : 'settings__main' | 195 | embed ? 'settings__main' : 'auth__container auth__container--signup' |
196 | } | 196 | } |
197 | > | 197 | > |
198 | {embed && ( | 198 | {embed && ( |
@@ -200,10 +200,10 @@ class Invite extends Component<IProps, IState> { | |||
200 | <H1>{intl.formatMessage(messages.settingsHeadline)}</H1> | 200 | <H1>{intl.formatMessage(messages.settingsHeadline)}</H1> |
201 | </div> | 201 | </div> |
202 | )} | 202 | )} |
203 | {!embed ? ( | 203 | {embed ? ( |
204 | <div>{renderForm}</div> | ||
205 | ) : ( | ||
206 | <div className="settings__body invite__form">{renderForm}</div> | 204 | <div className="settings__body invite__form">{renderForm}</div> |
205 | ) : ( | ||
206 | <div>{renderForm}</div> | ||
207 | )} | 207 | )} |
208 | </div> | 208 | </div> |
209 | ); | 209 | ); |
diff --git a/src/components/services/content/ServiceView.tsx b/src/components/services/content/ServiceView.tsx index e41184431..0754bccc5 100644 --- a/src/components/services/content/ServiceView.tsx +++ b/src/components/services/content/ServiceView.tsx | |||
@@ -135,29 +135,9 @@ class ServiceView extends Component<IProps, IState> { | |||
135 | )} | 135 | )} |
136 | </> | 136 | </> |
137 | )} | 137 | )} |
138 | {!service.isEnabled ? ( | 138 | {service.isEnabled ? ( |
139 | <> | 139 | <> |
140 | {service.isActive && ( | 140 | {service.isHibernating ? ( |
141 | <ServiceDisabled | ||
142 | name={service.name !== '' ? service.name : service.recipe.name} | ||
143 | // webview={service.webview} // TODO - [TECH DEBT][PROPS NOT EXIST IN COMPONENT] check it | ||
144 | enable={enable} | ||
145 | /> | ||
146 | )} | ||
147 | </> | ||
148 | ) : ( | ||
149 | <> | ||
150 | {!service.isHibernating ? ( | ||
151 | <> | ||
152 | {showNavBar && <WebControlsScreen service={service} />} | ||
153 | <ServiceWebview | ||
154 | service={service} | ||
155 | setWebviewReference={setWebviewRef} | ||
156 | detachService={detachService} | ||
157 | isSpellcheckerEnabled={isSpellcheckerEnabled} | ||
158 | /> | ||
159 | </> | ||
160 | ) : ( | ||
161 | <div | 141 | <div |
162 | style={{ | 142 | style={{ |
163 | display: 'flex', | 143 | display: 'flex', |
@@ -180,6 +160,26 @@ class ServiceView extends Component<IProps, IState> { | |||
180 | <br /> | 160 | <br /> |
181 | Try switching services or reloading Ferdium. | 161 | Try switching services or reloading Ferdium. |
182 | </div> | 162 | </div> |
163 | ) : ( | ||
164 | <> | ||
165 | {showNavBar && <WebControlsScreen service={service} />} | ||
166 | <ServiceWebview | ||
167 | service={service} | ||
168 | setWebviewReference={setWebviewRef} | ||
169 | detachService={detachService} | ||
170 | isSpellcheckerEnabled={isSpellcheckerEnabled} | ||
171 | /> | ||
172 | </> | ||
173 | )} | ||
174 | </> | ||
175 | ) : ( | ||
176 | <> | ||
177 | {service.isActive && ( | ||
178 | <ServiceDisabled | ||
179 | name={service.name === '' ? service.recipe.name : service.name} | ||
180 | // webview={service.webview} // TODO - [TECH DEBT][PROPS NOT EXIST IN COMPONENT] check it | ||
181 | enable={enable} | ||
182 | /> | ||
183 | )} | 183 | )} |
184 | </> | 184 | </> |
185 | )} | 185 | )} |
diff --git a/src/components/settings/navigation/SettingsNavigation.tsx b/src/components/settings/navigation/SettingsNavigation.tsx index 95c69027c..4e2c7f410 100644 --- a/src/components/settings/navigation/SettingsNavigation.tsx +++ b/src/components/settings/navigation/SettingsNavigation.tsx | |||
@@ -191,9 +191,9 @@ class SettingsNavigation extends Component<IProps> { | |||
191 | className="settings-navigation__link" | 191 | className="settings-navigation__link" |
192 | onClick={this.handleLogout.bind(this)} | 192 | onClick={this.handleLogout.bind(this)} |
193 | > | 193 | > |
194 | {!isUsingWithoutAccount | 194 | {isUsingWithoutAccount |
195 | ? intl.formatMessage(messages.logout) | 195 | ? 'Exit session' |
196 | : 'Exit session'} | 196 | : intl.formatMessage(messages.logout)} |
197 | </button> | 197 | </button> |
198 | </div> | 198 | </div> |
199 | ); | 199 | ); |
diff --git a/src/components/settings/services/ServiceItem.tsx b/src/components/settings/services/ServiceItem.tsx index fd961a0a8..0737a680c 100644 --- a/src/components/settings/services/ServiceItem.tsx +++ b/src/components/settings/services/ServiceItem.tsx | |||
@@ -63,7 +63,7 @@ class ServiceItem extends Component<IProps> { | |||
63 | onClick={goToServiceForm} | 63 | onClick={goToServiceForm} |
64 | role="gridcell" | 64 | role="gridcell" |
65 | > | 65 | > |
66 | {service.name !== '' ? service.name : service.recipe.name} | 66 | {service.name === '' ? service.recipe.name : service.name} |
67 | </td> | 67 | </td> |
68 | <td | 68 | <td |
69 | className="service-table__column-info" | 69 | className="service-table__column-info" |
diff --git a/src/components/ui/Loader.tsx b/src/components/ui/Loader.tsx index ebb437d9d..17cb35f41 100644 --- a/src/components/ui/Loader.tsx +++ b/src/components/ui/Loader.tsx | |||
@@ -25,7 +25,7 @@ class LoaderComponent extends Component<IProps> { | |||
25 | } = this.props; | 25 | } = this.props; |
26 | 26 | ||
27 | const loaderColor = | 27 | const loaderColor = |
28 | color !== 'ACCENT' ? color : this.props.stores!.settings.app.accentColor; | 28 | color === 'ACCENT' ? this.props.stores!.settings.app.accentColor : color; |
29 | 29 | ||
30 | return ( | 30 | return ( |
31 | <Loader | 31 | <Loader |
diff --git a/src/components/ui/Slider.tsx b/src/components/ui/Slider.tsx index ed9fe9073..be0846513 100644 --- a/src/components/ui/Slider.tsx +++ b/src/components/ui/Slider.tsx | |||
@@ -51,7 +51,7 @@ class Slider extends Component<IProps> { | |||
51 | value={field.value} | 51 | value={field.value} |
52 | min="1" | 52 | min="1" |
53 | max="100" | 53 | max="100" |
54 | onChange={e => (!disabled ? this.onChange(e) : null)} | 54 | onChange={e => (disabled ? null : this.onChange(e))} |
55 | /> | 55 | /> |
56 | </div> | 56 | </div> |
57 | 57 | ||
diff --git a/src/components/ui/button/index.tsx b/src/components/ui/button/index.tsx index dc984bf95..9444efde2 100644 --- a/src/components/ui/button/index.tsx +++ b/src/components/ui/button/index.tsx | |||
@@ -117,12 +117,12 @@ const styles = (theme: Theme) => ({ | |||
117 | zIndex: 9999, | 117 | zIndex: 9999, |
118 | }, | 118 | }, |
119 | loaderContainer: { | 119 | loaderContainer: { |
120 | width: (props: IProps): string => (!props.busy ? '0' : '40px'), | 120 | width: (props: IProps): string => (props.busy ? '40px' : '0'), |
121 | height: 20, | 121 | height: 20, |
122 | overflow: 'hidden', | 122 | overflow: 'hidden', |
123 | transition: loaderContainerTransition, | 123 | transition: loaderContainerTransition, |
124 | marginLeft: (props: IProps): number => (!props.busy ? 10 : 20), | 124 | marginLeft: (props: IProps): number => (props.busy ? 20 : 10), |
125 | marginRight: (props: IProps): number => (!props.busy ? -10 : -20), | 125 | marginRight: (props: IProps): number => (props.busy ? -20 : -10), |
126 | position: (): Property.Position => 'inherit', | 126 | position: (): Property.Position => 'inherit', |
127 | }, | 127 | }, |
128 | icon: { | 128 | icon: { |
@@ -217,38 +217,38 @@ class ButtonComponent extends Component<IProps, IState> { | |||
217 | </> | 217 | </> |
218 | ); | 218 | ); |
219 | 219 | ||
220 | const wrapperComponent = !href ? ( | 220 | const wrapperComponent = href ? ( |
221 | <button | 221 | <a |
222 | id={id} | 222 | href={href} |
223 | type={type} | 223 | target={target} |
224 | onClick={onClick} | 224 | onClick={onClick} |
225 | className={classnames({ | 225 | className={classnames({ |
226 | [`${classes.button}`]: true, | 226 | [`${classes.button}`]: true, |
227 | [`${classes[buttonType as ButtonType]}`]: true, | 227 | [`${classes[buttonType as ButtonType]}`]: true, |
228 | [`${classes.disabled}`]: disabled, | ||
229 | [`${className}`]: className, | 228 | [`${className}`]: className, |
230 | })} | 229 | })} |
231 | disabled={disabled} | 230 | rel={target === '_blank' ? 'noopener' : ''} |
232 | data-type="franz-button" | 231 | data-type="franz-button" |
233 | {...(htmlForm && { form: htmlForm })} | ||
234 | > | 232 | > |
235 | {content} | 233 | {content} |
236 | </button> | 234 | </a> |
237 | ) : ( | 235 | ) : ( |
238 | <a | 236 | <button |
239 | href={href} | 237 | id={id} |
240 | target={target} | 238 | type={type} |
241 | onClick={onClick} | 239 | onClick={onClick} |
242 | className={classnames({ | 240 | className={classnames({ |
243 | [`${classes.button}`]: true, | 241 | [`${classes.button}`]: true, |
244 | [`${classes[buttonType as ButtonType]}`]: true, | 242 | [`${classes[buttonType as ButtonType]}`]: true, |
243 | [`${classes.disabled}`]: disabled, | ||
245 | [`${className}`]: className, | 244 | [`${className}`]: className, |
246 | })} | 245 | })} |
247 | rel={target === '_blank' ? 'noopener' : ''} | 246 | disabled={disabled} |
248 | data-type="franz-button" | 247 | data-type="franz-button" |
248 | {...(htmlForm && { form: htmlForm })} | ||
249 | > | 249 | > |
250 | {content} | 250 | {content} |
251 | </a> | 251 | </button> |
252 | ); | 252 | ); |
253 | 253 | ||
254 | return wrapperComponent; | 254 | return wrapperComponent; |
diff --git a/src/components/ui/imageUpload/index.tsx b/src/components/ui/imageUpload/index.tsx index 89e2c65a2..3b164ed41 100644 --- a/src/components/ui/imageUpload/index.tsx +++ b/src/components/ui/imageUpload/index.tsx | |||
@@ -46,7 +46,7 @@ class ImageUpload extends Component<IProps, IState> { | |||
46 | this.setState({ errorState: false }); | 46 | this.setState({ errorState: false }); |
47 | 47 | ||
48 | for (const file of acceptedFiles) { | 48 | for (const file of acceptedFiles) { |
49 | const imgPath = isWindows ? file.path.replace(/\\/g, '/') : file.path; | 49 | const imgPath = isWindows ? file.path.replaceAll('\\', '/') : file.path; |
50 | this.setState({ | 50 | this.setState({ |
51 | path: imgPath, | 51 | path: imgPath, |
52 | }); | 52 | }); |
diff --git a/src/components/ui/select/index.tsx b/src/components/ui/select/index.tsx index 31aa8a15f..695e70e28 100644 --- a/src/components/ui/select/index.tsx +++ b/src/components/ui/select/index.tsx | |||
@@ -321,10 +321,12 @@ class SelectComponent extends Component<IProps, IState> { | |||
321 | case 39: | 321 | case 39: |
322 | case 38: | 322 | case 38: |
323 | case 40: // Arrow keys | 323 | case 40: // Arrow keys |
324 | case 32: | 324 | case 32: { |
325 | break; // Space | 325 | break; |
326 | default: | 326 | } // Space |
327 | break; // do not block other keys | 327 | default: { |
328 | break; | ||
329 | } // do not block other keys | ||
328 | } | 330 | } |
329 | } | 331 | } |
330 | 332 | ||
@@ -381,12 +383,12 @@ class SelectComponent extends Component<IProps, IState> { | |||
381 | [`${classes.hasError}`]: error, | 383 | [`${classes.hasError}`]: error, |
382 | })} | 384 | })} |
383 | onClick={ | 385 | onClick={ |
384 | !disabled | 386 | disabled |
385 | ? () => | 387 | ? noop |
388 | : () => | ||
386 | this.setState((state: IState) => ({ | 389 | this.setState((state: IState) => ({ |
387 | open: !state.open, | 390 | open: !state.open, |
388 | })) | 391 | })) |
389 | : noop | ||
390 | } | 392 | } |
391 | > | 393 | > |
392 | {selection} | 394 | {selection} |