comment server selector functional now, some cleanup

This commit is contained in:
zeppi 2022-02-02 16:49:18 -05:00 committed by jessopb
parent d13397d4dd
commit 6b37fd2eae
5 changed files with 15 additions and 14 deletions

View file

@ -85,7 +85,7 @@ function ServerInputRow(props: Props) {
</div>
<div className="itemPanel--input">
<FormField
label={'Use Https'}
label={'Use https'}
name="use_https"
type="checkbox"
checked={useHttps}

View file

@ -34,25 +34,12 @@ function SettingCommentsServer(props: Props) {
// if customServerUrl is not in servers, make sure it is.
}, [customServerUrl, customServersString, setCustomServers]);
// React.useEffect(() => {
// const timer = setTimeout(() => {
// Comments.setServerUrl(customServerEnabled ? url : undefined);
// if (url !== customServerUrl) {
// setCustomServerUrl(url);
// }
// }, DEBOUNCE_TEXT_INPUT_MS);
//
// return () => clearTimeout(timer);
// }, [url, customServerUrl, customServerEnabled, setCustomServerUrl]);
const handleSelectServer = (serverItem: CommentServerDetails) => {
if (serverItem.url !== COMMENT_SERVER_API) {
alert(`set ${serverItem.url}`);
Comments.setServerUrl(serverItem.url);
setCustomServerUrl(serverItem.url);
setCustomServerEnabled(true);
} else {
alert('reset');
Comments.setServerUrl(undefined);
setCustomServerEnabled(false);
}
@ -63,6 +50,7 @@ function SettingCommentsServer(props: Props) {
newCustomServers.push(serverItem);
setCustomServers(newCustomServers);
handleSelectServer(serverItem);
setAddServer(false);
};
const handleRemoveServer = (serverItem) => {

View file

@ -43,11 +43,13 @@ $thumbnailWidthSmall: 1rem;
.commentCreate__labelWrapper {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: baseline;
flex-wrap: wrap;
width: 100%;
max-width: 50%;
.commentCreate__label {
white-space: nowrap;

View file

@ -38,5 +38,15 @@
}
.itemPanel--input {
min-height: var(--spacing-l);
padding: 0 0 var(--spacing-s) 0;
fieldset-section,
.fieldset-group {
margin-top: var(--spacing-m);
}
&.checkbox,
.checkbox:only-child {
height: var(--spacing-l);
float: left;
}
}

View file

@ -224,6 +224,7 @@
min-width: 60%;
max-width: 60%;
}
margin-bottom: var(--spacing-m);
}
.settings__row-section-title {