Skip to content

Commit

Permalink
chore(web): multiple bug fixes (#854)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaWaite authored Dec 7, 2023
1 parent 0b60ec5 commit 5740377
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 30 deletions.
12 changes: 9 additions & 3 deletions web/src/beta/components/CheckboxField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const CheckBoxField: React.FC<Props> = ({ onClick, checked, label }) => {
<Field onClick={() => onClick?.(!checked)}>
<BoxField>{checked && <CheckMark icon="checkmark" />}</BoxField>
{label && (
<Text size="footnote" color={theme.content.main}>
<StyledText size="footnote" color={theme.content.main}>
{label}
</Text>
</StyledText>
)}
</Field>
);
Expand All @@ -27,7 +27,13 @@ const Field = styled.button`
align-items: center;
gap: 12px;
width: 100%;
height: 20px;
min-height: 20px;
`;

const StyledText = styled(Text)`
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
`;

const BoxField = styled.div`
Expand Down
1 change: 0 additions & 1 deletion web/src/beta/components/ListItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ const Wrapper = styled.div<{
const Inner = styled.div`
display: flex;
align-items: center;
height: 100%;
width: 100%;
padding: 8px 4px 8px 4px;
border-radius: 4px;
Expand Down
12 changes: 9 additions & 3 deletions web/src/beta/components/fields/CameraField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ const CameraField: React.FC<Props> = ({
<InputWrapper disabled={disabled}>
<Input positionSet={!!value}>
{value && <ZoomToIcon icon="zoomToLayer" size={10} onClick={handleFlyto} />}
<Text size="footnote" customColor>
<StyledText size="footnote" customColor>
{value ? t("Position Set") : t("Not set")}
</Text>
</StyledText>
<DeleteIcon icon="bin" size={10} disabled={!value} onClick={handleRemoveSetting} />
</Input>
<TriggerButton
Expand Down Expand Up @@ -128,7 +128,7 @@ const CameraField: React.FC<Props> = ({
const InputWrapper = styled.div<{ disabled?: boolean }>`
display: flex;
gap: 10px;
height: 28px;
flex-wrap: wrap;
opacity: ${({ disabled }) => (disabled ? 0.6 : 1)};
`;
Expand All @@ -140,6 +140,7 @@ const Input = styled.div<{ positionSet?: boolean }>`
gap: 4px;
flex: 1;
padding: 0 8px;
height: 28px;
border-radius: 4px;
border: 1px solid ${({ theme }) => theme.outline.weak};
color: ${({ theme }) => theme.content.main};
Expand All @@ -149,7 +150,12 @@ const Input = styled.div<{ positionSet?: boolean }>`
color: ${({ theme, positionSet }) => (positionSet ? theme.content.main : theme.content.weak)};
`;

const StyledText = styled(Text)`
white-space: nowrap;
`;

const TriggerButton = styled(Button)`
height: 28px;
margin: 0;
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const LayerItem = ({
]}
/>
}>
<ContentWrapper>
<>
{isEditing ? (
<StyledTextInput
value={newValue}
Expand All @@ -113,34 +113,25 @@ const LayerItem = ({
onBlur={handleEditExit}
/>
) : (
<LayerTitle onDoubleClick={handleDoubleClick}>{layerTitle}</LayerTitle>
<TitleText size="footnote" onDoubleClick={handleDoubleClick}>
{layerTitle}
</TitleText>
)}
<HideLayer onClick={handleUpdateVisibility}>
<Text size="footnote">{value}</Text>
</HideLayer>
</ContentWrapper>
</>
</ListItem>
);
};

export default LayerItem;

const LayerTitle = styled.div`
overflow: hidden;
color: ${({ theme }) => theme.content.main};
text-overflow: ellipsis;
font-family: Noto Sans;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 20px;
`;

const ContentWrapper = styled.div`
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
const TitleText = styled(Text)`
flex: 1;
word-break: break-all;
text-align: left;
padding-right: 10px;
`;

const HideLayer = styled.div`
Expand Down
8 changes: 4 additions & 4 deletions web/src/services/api/pluginsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ export default () => {
);

const [installPluginMutation] = useMutation(INSTALL_PLUGIN, {
refetchQueries: ["GET_SCENE"],
refetchQueries: ["GetScene"],
});
const [upgradePluginMutation] = useMutation(UPGRADE_PLUGIN, {
refetchQueries: ["GET_SCENE"],
refetchQueries: ["GetScene"],
});

const useInstallPlugin = useCallback(
Expand Down Expand Up @@ -151,7 +151,7 @@ export default () => {
);

const [uploadPluginMutation] = useMutation(UPLOAD_PLUGIN, {
refetchQueries: ["GET_SCENE"],
refetchQueries: ["GetScene"],
});

const useUploadPlugin = useCallback(
Expand Down Expand Up @@ -188,7 +188,7 @@ export default () => {
);

const [uninstallPluginMutation] = useMutation(UNINSTALL_PLUGIN, {
refetchQueries: ["GET_SCENE"],
refetchQueries: ["GetScene"],
});

const useUninstallPlugin = useCallback(
Expand Down

0 comments on commit 5740377

Please sign in to comment.