CR fixes and imprve layour

This commit is contained in:
Lukasz Ostrowski 2023-06-27 11:45:37 +02:00
parent 2b27c0c463
commit 7946576714
5 changed files with 36 additions and 37 deletions

View file

@ -16,7 +16,9 @@
"@material-ui/lab": "4.0.0-alpha.61", "@material-ui/lab": "4.0.0-alpha.61",
"@saleor/app-sdk": "0.40.1", "@saleor/app-sdk": "0.40.1",
"@saleor/apps-shared": "workspace:*", "@saleor/apps-shared": "workspace:*",
"@saleor/apps-ui": "workspace:*",
"@saleor/macaw-ui": "0.8.0-pre.95", "@saleor/macaw-ui": "0.8.0-pre.95",
"@saleor/react-hook-form-macaw": "workspace:*",
"@sentry/nextjs": "7.55.2", "@sentry/nextjs": "7.55.2",
"@urql/exchange-auth": "^2.1.4", "@urql/exchange-auth": "^2.1.4",
"clsx": "^1.2.1", "clsx": "^1.2.1",

View file

@ -6,10 +6,11 @@ type Props = PropsWithChildren<{}>;
export const AppColumnsLayout = ({ children }: Props) => { export const AppColumnsLayout = ({ children }: Props) => {
return ( return (
<Box <Box
paddingX={8}
display={"grid"} display={"grid"}
marginTop={8} marginTop={8}
__maxWidth={"1180px"} __maxWidth={"1180px"}
__gridTemplateColumns={"280px auto 280px"} __gridTemplateColumns={"380px auto"}
gap={8} gap={8}
> >
{children} {children}

View file

@ -8,6 +8,8 @@ import { AppColumnsLayout } from "../components/AppColumnsLayout/AppColumnsLayou
import { useDashboardNotification } from "@saleor/apps-shared"; import { useDashboardNotification } from "@saleor/apps-shared";
import { Input, Text, Box, Button } from "@saleor/macaw-ui/next"; import { Input, Text, Box, Button } from "@saleor/macaw-ui/next";
import { TextLink } from "@saleor/apps-ui";
import { AccessWarning } from "../components/AccessWarning/AccessWarning"; import { AccessWarning } from "../components/AccessWarning/AccessWarning";
interface ConfigurationField { interface ConfigurationField {
@ -116,39 +118,27 @@ function Instructions() {
return ( return (
<> <>
<Text variant={"bodyStrong"}>How to configure</Text> <Text variant={"heading"}>How to configure</Text>
<ul> <Box display={"flex"} gap={2} as={"ul"} flexDirection={"column"}>
<li> <li>
<a <TextLink href={slackUrl.href}>1. Install Slack application</TextLink>
onClick={(e) => {
e.preventDefault();
openExternalUrl(slackUrl.href);
}}
href={slackUrl.href}
>
<Text>Install Slack application</Text>
</a>
</li> </li>
<li> <li>
<Text> <Text>
Copy incoming Webhook URL from Slack app configuration and paste it below into 2. Copy incoming Webhook URL from Slack app configuration and paste it below into{" "}
`WEBHOOK_URL` field <Text variant={"bodyStrong"}>WEBHOOK_URL</Text> field
</Text> </Text>
</li> </li>
<li>Save configuration</li> <li>
</ul> <Text>3. Save configuration</Text>
<Text variant={"bodyStrong"}>Useful links</Text> </li>
</Box>
<Text variant={"heading"}>Useful links</Text>
<ul> <ul>
<li> <li>
<a <TextLink newTab href={"https://api.slack.com/messaging/webhooks"}>
onClick={(e) => { Read about Slack apps that use incoming webhooks
e.preventDefault(); </TextLink>
openExternalUrl("https://api.slack.com/messaging/webhooks");
}}
href="https://api.slack.com/messaging/webhooks"
>
<Text>Read about Slack apps that use incoming webhooks</Text>
</a>
</li> </li>
</ul> </ul>
</> </>
@ -164,21 +154,21 @@ const ConfigurationWithAuth = withAuthorization({
ConfigurationWithAuth.getLayout = (page: ReactElement) => ( ConfigurationWithAuth.getLayout = (page: ReactElement) => (
<AppColumnsLayout> <AppColumnsLayout>
<div /> <Box marginBottom={4}>
<Box> <Instructions />
</Box>
<Box
borderColor={"neutralHighlight"}
borderStyle={"solid"}
borderWidth={1}
padding={4}
borderRadius={4}
>
<Text as={"h2"} marginBottom={4} variant={"heading"}> <Text as={"h2"} marginBottom={4} variant={"heading"}>
Configuration Configuration
</Text> </Text>
<Box>{page}</Box> <Box>{page}</Box>
</Box> </Box>
<Box marginBottom={4}>
<Text as={"h2"} marginBottom={4} variant={"heading"}>
Instructions
</Text>
<Box>
<Instructions />
</Box>
</Box>
</AppColumnsLayout> </AppColumnsLayout>
); );

View file

@ -29,7 +29,7 @@ const IndexPage: NextPage = () => {
<Text as={"p"}>This is Saleor App that allows invoices generation</Text> <Text as={"p"}>This is Saleor App that allows invoices generation</Text>
<Text as={"p"}> <Text as={"p"}>
Install app in your Saleor instance and open in with Dashboard{" "} Install app in your Saleor instance and open in with Dashboard{" "}
<a href={"https://github.com/saleor/apps"}>or check it on Github</a> <a href={"https://github.com/saleor/apps"}>or check it on GitHub</a>
</Text> </Text>
</Box> </Box>
); );

View file

@ -1273,9 +1273,15 @@ importers:
'@saleor/apps-shared': '@saleor/apps-shared':
specifier: workspace:* specifier: workspace:*
version: link:../../packages/shared version: link:../../packages/shared
'@saleor/apps-ui':
specifier: workspace:*
version: link:../../packages/ui
'@saleor/macaw-ui': '@saleor/macaw-ui':
specifier: 0.8.0-pre.95 specifier: 0.8.0-pre.95
version: 0.8.0-pre.95(@types/react-dom@18.2.5)(@types/react@18.2.5)(react-dom@18.2.0)(react@18.2.0) version: 0.8.0-pre.95(@types/react-dom@18.2.5)(@types/react@18.2.5)(react-dom@18.2.0)(react@18.2.0)
'@saleor/react-hook-form-macaw':
specifier: workspace:*
version: link:../../packages/react-hook-form-macaw
'@sentry/nextjs': '@sentry/nextjs':
specifier: 7.55.2 specifier: 7.55.2
version: 7.55.2(next@13.3.0)(react@18.2.0) version: 7.55.2(next@13.3.0)(react@18.2.0)