From 5371559c742be1af2847847e7b61ebb986a1c998 Mon Sep 17 00:00:00 2001 From: gabek Date: Sun, 23 May 2021 06:28:21 +0000 Subject: [PATCH] Prettified Code! --- web/components/config/edit-social-links.tsx | 10 +++++++--- .../config/form-textfield-with-submit.tsx | 5 ++++- web/styles/globals.scss | 5 ++--- web/utils/config-constants.tsx | 17 ++++++----------- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/web/components/config/edit-social-links.tsx b/web/components/config/edit-social-links.tsx index d51b43463..dc00563e3 100644 --- a/web/components/config/edit-social-links.tsx +++ b/web/components/config/edit-social-links.tsx @@ -184,7 +184,9 @@ export default function EditSocialLinks() {

{platform} - {url} + + {url} +

); @@ -195,11 +197,13 @@ export default function EditSocialLinks() { return (
- +

{platformName} - {url} + + {url} +

); diff --git a/web/components/config/form-textfield-with-submit.tsx b/web/components/config/form-textfield-with-submit.tsx index 33aec1498..0d25ab1b6 100644 --- a/web/components/config/form-textfield-with-submit.tsx +++ b/web/components/config/form-textfield-with-submit.tsx @@ -71,7 +71,10 @@ export default function TextFieldWithSubmit(props: TextFieldWithSubmitProps) { // if field is required but value is empty, or equals initial value, then don't show submit/update button. otherwise clear out any result messaging and display button. const handleChange = ({ fieldName: changedFieldName, value: changedValue }: UpdateArgs) => { if (onChange) { - onChange({ fieldName: changedFieldName, value: useTrim ? changedValue.trim() : changedValue }); + onChange({ + fieldName: changedFieldName, + value: useTrim ? changedValue.trim() : changedValue, + }); } }; diff --git a/web/styles/globals.scss b/web/styles/globals.scss index 3b71b9944..b1393b02d 100644 --- a/web/styles/globals.scss +++ b/web/styles/globals.scss @@ -112,11 +112,10 @@ strong { } } - input { &:not(:focus) { - &:invalid { + &:invalid { color: var(--ant-error); - } + } } } diff --git a/web/utils/config-constants.tsx b/web/utils/config-constants.tsx index c90df5442..c5015f1cc 100644 --- a/web/utils/config-constants.tsx +++ b/web/utils/config-constants.tsx @@ -78,8 +78,7 @@ export const TEXTFIELD_PROPS_SERVER_WELCOME_MESSAGE = { maxLength: 500, placeholder: '', label: 'Welcome Message', - tip: - 'A system chat message sent to viewers when they first connect to chat. Leave blank to disable.', + tip: 'A system chat message sent to viewers when they first connect to chat. Leave blank to disable.', }; export const TEXTFIELD_PROPS_LOGO = { apiPath: API_LOGO, @@ -87,8 +86,7 @@ export const TEXTFIELD_PROPS_LOGO = { maxLength: 255, placeholder: '/img/mylogo.png', label: 'Logo', - tip: - 'Upload your logo if you have one. We recommend that you use a square image that is at least 256x256.', + tip: 'Upload your logo if you have one. We recommend that you use a square image that is at least 256x256.', }; export const TEXTFIELD_PROPS_STREAM_KEY = { apiPath: API_STREAM_KEY, @@ -152,8 +150,7 @@ export const FIELD_PROPS_NSFW = { apiPath: API_NSFW_SWITCH, configPath: 'instanceDetails', label: 'NSFW?', - tip: - "Turn this ON if you plan to steam explicit or adult content. Please respectfully set this flag so unexpected eyes won't accidentally see it in the Directory.", + tip: "Turn this ON if you plan to steam explicit or adult content. Please respectfully set this flag so unexpected eyes won't accidentally see it in the Directory.", }; export const FIELD_PROPS_YP = { @@ -222,8 +219,7 @@ export const FRAMERATE_DEFAULTS = { defaultValue: 24, unit: 'fps', incrementBy: null, - tip: - 'Reducing your framerate will decrease the amount of video that needs to be encoded and sent to your viewers, saving CPU and bandwidth at the expense of smoothness. A lower value is generally is fine for most content.', + tip: 'Reducing your framerate will decrease the amount of video that needs to be encoded and sent to your viewers, saving CPU and bandwidth at the expense of smoothness. A lower value is generally is fine for most content.', }; export const FRAMERATE_SLIDER_MARKS = { [FRAMERATE_DEFAULTS.min]: `${FRAMERATE_DEFAULTS.min} ${FRAMERATE_DEFAULTS.unit}`, @@ -321,7 +317,7 @@ export const S3_TEXT_FIELDS_INFO = { tip: 'The full URL (with "https://") endpoint from your storage provider.', useTrim: true, type: TEXTFIELD_TYPE_URL, - pattern: DEFAULT_TEXTFIELD_URL_PATTERN, + pattern: DEFAULT_TEXTFIELD_URL_PATTERN, }, region: { fieldName: 'region', @@ -342,8 +338,7 @@ export const S3_TEXT_FIELDS_INFO = { label: 'Serving Endpoint', maxLength: 255, placeholder: 'http://cdn.ss3.provider.endpoint.com', - tip: - 'Optional URL that content should be accessed from instead of the default. Used with CDNs and specific storage providers. Generally not required.', + tip: 'Optional URL that content should be accessed from instead of the default. Used with CDNs and specific storage providers. Generally not required.', type: TEXTFIELD_TYPE_URL, pattern: DEFAULT_TEXTFIELD_URL_PATTERN, useTrim: true,