-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3071 from mirumee/tsx/implement-site-settings
Implement site settings
- Loading branch information
Showing
31 changed files
with
1,998 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...static/dashboard-next/siteSettings/components/SiteSettingsDetails/SiteSettingsDetails.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import Card from "@material-ui/core/Card"; | ||
import CardContent from "@material-ui/core/CardContent"; | ||
import TextField from "@material-ui/core/TextField"; | ||
import * as React from "react"; | ||
|
||
import CardTitle from "../../../components/CardTitle"; | ||
import FormSpacer from "../../../components/FormSpacer"; | ||
import i18n from "../../../i18n"; | ||
import { SiteSettingsPageFormData } from "../SiteSettingsPage"; | ||
|
||
interface SiteSettingsDetailsProps { | ||
data: SiteSettingsPageFormData; | ||
errors: Partial<{ | ||
description: string; | ||
domain: string; | ||
name: string; | ||
}>; | ||
disabled: boolean; | ||
onChange: (event: React.ChangeEvent<any>) => void; | ||
} | ||
|
||
const SiteSettingsDetails: React.StatelessComponent< | ||
SiteSettingsDetailsProps | ||
> = ({ data, disabled, errors, onChange }) => ( | ||
<Card> | ||
<CardTitle | ||
title={i18n.t("General Information", { | ||
context: "store configuration" | ||
})} | ||
/> | ||
<CardContent> | ||
<TextField | ||
disabled={disabled} | ||
error={!!errors.name} | ||
fullWidth | ||
name="name" | ||
label={i18n.t("Name of your store")} | ||
helperText={ | ||
errors.name || | ||
i18n.t("Name of your store is shown on tab in web browser") | ||
} | ||
value={data.name} | ||
onChange={onChange} | ||
/> | ||
<FormSpacer /> | ||
<TextField | ||
disabled={disabled} | ||
error={!!errors.domain} | ||
fullWidth | ||
name="domain" | ||
label={i18n.t("URL of your online store")} | ||
helperText={errors.domain} | ||
value={data.domain} | ||
onChange={onChange} | ||
/> | ||
<FormSpacer /> | ||
<TextField | ||
disabled={disabled} | ||
error={!!errors.domain} | ||
fullWidth | ||
name="description" | ||
label={i18n.t("Store Description", { | ||
context: "field label" | ||
})} | ||
helperText={ | ||
errors.description || | ||
i18n.t( | ||
"Store description is shown on taskbar after your store name", | ||
{ | ||
context: "help text" | ||
} | ||
) | ||
} | ||
value={data.description} | ||
onChange={onChange} | ||
/> | ||
</CardContent> | ||
</Card> | ||
); | ||
SiteSettingsDetails.displayName = "SiteSettingsDetails"; | ||
export default SiteSettingsDetails; |
2 changes: 2 additions & 0 deletions
2
saleor/static/dashboard-next/siteSettings/components/SiteSettingsDetails/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default } from "./SiteSettingsDetails"; | ||
export * from "./SiteSettingsDetails"; |
Oops, something went wrong.