comment server selector functional now, some cleanup
This commit is contained in:
parent
d13397d4dd
commit
6b37fd2eae
5 changed files with 15 additions and 14 deletions
|
@ -85,7 +85,7 @@ function ServerInputRow(props: Props) {
|
||||||
</div>
|
</div>
|
||||||
<div className="itemPanel--input">
|
<div className="itemPanel--input">
|
||||||
<FormField
|
<FormField
|
||||||
label={'Use Https'}
|
label={'Use https'}
|
||||||
name="use_https"
|
name="use_https"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={useHttps}
|
checked={useHttps}
|
||||||
|
|
|
@ -34,25 +34,12 @@ function SettingCommentsServer(props: Props) {
|
||||||
// if customServerUrl is not in servers, make sure it is.
|
// if customServerUrl is not in servers, make sure it is.
|
||||||
}, [customServerUrl, customServersString, setCustomServers]);
|
}, [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) => {
|
const handleSelectServer = (serverItem: CommentServerDetails) => {
|
||||||
if (serverItem.url !== COMMENT_SERVER_API) {
|
if (serverItem.url !== COMMENT_SERVER_API) {
|
||||||
alert(`set ${serverItem.url}`);
|
|
||||||
Comments.setServerUrl(serverItem.url);
|
Comments.setServerUrl(serverItem.url);
|
||||||
setCustomServerUrl(serverItem.url);
|
setCustomServerUrl(serverItem.url);
|
||||||
setCustomServerEnabled(true);
|
setCustomServerEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
alert('reset');
|
|
||||||
Comments.setServerUrl(undefined);
|
Comments.setServerUrl(undefined);
|
||||||
setCustomServerEnabled(false);
|
setCustomServerEnabled(false);
|
||||||
}
|
}
|
||||||
|
@ -63,6 +50,7 @@ function SettingCommentsServer(props: Props) {
|
||||||
newCustomServers.push(serverItem);
|
newCustomServers.push(serverItem);
|
||||||
setCustomServers(newCustomServers);
|
setCustomServers(newCustomServers);
|
||||||
handleSelectServer(serverItem);
|
handleSelectServer(serverItem);
|
||||||
|
setAddServer(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRemoveServer = (serverItem) => {
|
const handleRemoveServer = (serverItem) => {
|
||||||
|
|
|
@ -43,11 +43,13 @@ $thumbnailWidthSmall: 1rem;
|
||||||
|
|
||||||
.commentCreate__labelWrapper {
|
.commentCreate__labelWrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
max-width: 50%;
|
||||||
|
|
||||||
.commentCreate__label {
|
.commentCreate__label {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
|
@ -38,5 +38,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.itemPanel--input {
|
.itemPanel--input {
|
||||||
|
min-height: var(--spacing-l);
|
||||||
padding: 0 0 var(--spacing-s) 0;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,6 +224,7 @@
|
||||||
min-width: 60%;
|
min-width: 60%;
|
||||||
max-width: 60%;
|
max-width: 60%;
|
||||||
}
|
}
|
||||||
|
margin-bottom: var(--spacing-m);
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings__row-section-title {
|
.settings__row-section-title {
|
||||||
|
|
Loading…
Reference in a new issue