Skip to content

Commit

Permalink
chore(web): color bug fix (#843)
Browse files Browse the repository at this point in the history
Co-authored-by: KaWaite <[email protected]>
Co-authored-by: keiya sasaki <[email protected]>
Co-authored-by: nina992 <[email protected]>
Co-authored-by: nina992 <[email protected]>
Co-authored-by: pyshx <[email protected]>
  • Loading branch information
6 people authored Dec 1, 2023
1 parent 17bcc69 commit 76f514f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
7 changes: 0 additions & 7 deletions web/src/beta/components/fields/ColorField/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ export default ({ value, onChange }: Params) => {
}
}, [value]);

useEffect(() => {
if (!value) return;
if (rgba && tinycolor(rgba).toHex8String() !== value) {
setColor(tinycolor(rgba).toHex8String());
}
}, [rgba]); // eslint-disable-line react-hooks/exhaustive-deps

useEffect(() => {
const handleClickOutside = (e: MouseEvent | TouchEvent) => {
if (open && wrapperRef.current && !wrapperRef.current.contains(e.target as Node)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const VectorTiles: FC<DataProps> = ({ sceneId, onSubmit, onClose }) => {
description={t("Layer of the data source you want to add.")}>
{layers.map((layer: string, index: number) => (
<LayerWrapper key={index}>
<Input type="text" placeholder={`${layer}`} disabled={true} />
<Input type="text" value={`${layer}`} disabled={true} />
<DeleteLayerIcon icon="bin" size={16} onClick={() => handleDeleteLayer(index)} />
</LayerWrapper>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const WmsTiles: FC<DataProps> = ({ sceneId, onSubmit, onClose }) => {
description={t("Layer of the data source you want to add.")}>
{layers.map((layer: string, index: number) => (
<LayerWrapper key={index}>
<Input type="text" placeholder={`${layer}`} disabled={true} />
<Input type="text" value={`${layer}`} disabled={true} />
<DeleteLayerIcon icon="bin" size={16} onClick={() => handleDeleteLayer(index)} />
</LayerWrapper>
))}
Expand Down
3 changes: 3 additions & 0 deletions web/src/beta/features/Editor/DataSourceManager/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export const Input = styled.input`
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
::placeholder {
color: ${({ theme }) => theme.content.weaker};
}
`;

export const AssetWrapper = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const FieldComponent = ({
<ColorField
name={field?.title}
description={field?.description}
value={field?.value}
onChange={handlePropertyValueUpdate(groupId, propertyId, fieldId, field?.type)}
/>
) : field?.ui === "selection" || field?.choices ? (
Expand Down

0 comments on commit 76f514f

Please sign in to comment.