Skip to content

Commit 4e08d5d

Browse files
authored
refactor(web): improve buttons for alias setting [VIZ-1653] (#1612)
1 parent 5c19ab8 commit 4e08d5d

File tree

4 files changed

+19
-25
lines changed

4 files changed

+19
-25
lines changed

web/src/beta/features/ProjectSettings/innerPages/PublicSettings/AliasSettings/EditPanel.tsx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,21 @@ const EditPanel: FC<Prop> = ({
8888
<ModalPanel
8989
title={t("Edit Alias")}
9090
onCancel={onClose}
91-
actions={
92-
<ButtonWrapper>
93-
<Button extendWidth title={t("Cancel")} onClick={onClose} />
94-
<Button
95-
extendWidth
96-
title={t("Apply")}
97-
appearance="primary"
98-
disabled={isDisabled}
99-
onClick={handleSubmit}
100-
/>
101-
</ButtonWrapper>
102-
}
91+
actions={[
92+
<Button
93+
key="cancel"
94+
title={t("Cancel")}
95+
appearance="secondary"
96+
onClick={onClose}
97+
/>,
98+
<Button
99+
key="apply"
100+
title={t("Apply")}
101+
appearance="primary"
102+
disabled={isDisabled}
103+
onClick={handleSubmit}
104+
/>
105+
]}
103106
>
104107
<Wrapper>
105108
<Typography size="body">
@@ -167,13 +170,6 @@ const InputWrapper = styled("div")<{ hasSuffix?: boolean }>(
167170
})
168171
);
169172

170-
const ButtonWrapper = styled("div")(({ theme }) => ({
171-
display: "flex",
172-
justifyContent: "center",
173-
alignItems: "flex-start",
174-
gap: theme.spacing.small
175-
}));
176-
177173
const WarningMessage = styled("div")(({ theme }) => ({
178174
color: theme.dangerous.main,
179175
display: "flex",

web/src/beta/features/ProjectSettings/innerPages/PublicSettings/AliasSettings/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
import { config } from "@reearth/services/config";
1313
import { useT } from "@reearth/services/i18n";
1414
import { useNotification } from "@reearth/services/state";
15-
import { styled, useTheme } from "@reearth/services/theme";
15+
import { styled } from "@reearth/services/theme";
1616
import { FC, useCallback, useMemo, useState } from "react";
1717

1818
import { PublicAliasSettingsType } from "..";
@@ -38,7 +38,6 @@ const AliasSetting: FC<AliasSettingProps> = ({
3838
settingsItem,
3939
onUpdateAlias
4040
}) => {
41-
const theme = useTheme();
4241
const t = useT();
4342
const { checkProjectAlias } = useProjectFetcher();
4443
const { checkStoryAlias } = useStorytellingFetcher();
@@ -124,11 +123,10 @@ const AliasSetting: FC<AliasSettingProps> = ({
124123
</UrlWrapper>
125124
<Button
126125
appearance="secondary"
127-
title={t("clean")}
126+
title={t("Reset")}
128127
icon="pencilLine"
129128
size="small"
130129
disabled={isDisabled}
131-
iconColor={theme.content.weak}
132130
onClick={handleCleanAlias}
133131
/>
134132

web/src/services/i18n/translations/en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ Edit Alias: ''
401401
You are about to change the alias for your story. Only alphanumeric characters and hyphens are allows.: ''
402402
You are about to change the alias for your project. Only alphanumeric characters and hyphens are allows.: ''
403403
Your Alias: ''
404-
clean: ''
404+
Reset: ''
405405
Public Info: ''
406406
Published page settings: ''
407407
This section's settings are mainly applied to the Open Graph Protocol settings in the header of the published page.: ''

web/src/services/i18n/translations/ja.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ Edit Alias: エイリアスを編集
404404
You are about to change the alias for your story. Only alphanumeric characters and hyphens are allows.: ストーリーのエイリアスを変更しようとしています。英数字とハイフンのみが使用可能です。
405405
You are about to change the alias for your project. Only alphanumeric characters and hyphens are allows.: プロジェクトのエイリアスを変更しようとしています。英数字とハイフンのみが使用可能です。
406406
Your Alias: あなたのエイリアス'
407-
clean: ''
407+
Reset: リセット
408408
Public Info: 公開情報
409409
Published page settings: 公開ページ設定
410410
This section's settings are mainly applied to the Open Graph Protocol settings in the header of the published page.: このセクションの設定は、主に公開ページのヘッダーにあるOpen Graph Protocolの設定に適用されます。

0 commit comments

Comments
 (0)