Improve Invoices App UI (#182)
* Improve Invoices App UI * Create clean-onions-sparkle.md * Update apps/invoices/src/modules/app-configuration/ui/address-form.tsx Co-authored-by: Adrian Pilarczyk <admin@peelar.dev> --------- Co-authored-by: Adrian Pilarczyk <admin@peelar.dev>
This commit is contained in:
parent
ea850d34ab
commit
b3178b2d56
6 changed files with 27 additions and 22 deletions
5
.changeset/clean-onions-sparkle.md
Normal file
5
.changeset/clean-onions-sparkle.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"saleor-app-invoices": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Improve UI - better styling, headers
|
|
@ -5,18 +5,19 @@ import { Button, makeStyles } from "@saleor/macaw-ui";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { actions, useAppBridge } from "@saleor/app-sdk/app-bridge";
|
import { actions, useAppBridge } from "@saleor/app-sdk/app-bridge";
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
const useStyles = makeStyles((theme) => ({
|
||||||
field: {
|
field: {
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
padding: 20,
|
padding: 20,
|
||||||
|
paddingTop: 0,
|
||||||
},
|
},
|
||||||
channelName: {
|
channelName: {
|
||||||
fontFamily: "monospace",
|
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
|
borderBottom: `2px solid ${theme.palette.secondary.main}`,
|
||||||
},
|
},
|
||||||
});
|
}));
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
channelSlug: string;
|
channelSlug: string;
|
||||||
|
@ -53,11 +54,11 @@ export const AddressForm = (props: Props) => {
|
||||||
})}
|
})}
|
||||||
className={styles.form}
|
className={styles.form}
|
||||||
>
|
>
|
||||||
<Typography variant="body1" paragraph>
|
<Typography component="h3" variant="h3" paragraph>
|
||||||
Configure
|
Configure
|
||||||
<strong onClick={handleChannelNameClick} className={styles.channelName}>
|
<span onClick={handleChannelNameClick} className={styles.channelName}>
|
||||||
{` ${props.channelName} `}
|
{` ${props.channelName} `}
|
||||||
</strong>
|
</span>
|
||||||
channel:
|
channel:
|
||||||
</Typography>
|
</Typography>
|
||||||
<TextField label="Company Name" {...CommonFieldProps} {...register("companyName")} />
|
<TextField label="Company Name" {...CommonFieldProps} {...register("companyName")} />
|
||||||
|
|
|
@ -14,9 +14,7 @@ const useStyles = makeStyles((theme) => {
|
||||||
return {
|
return {
|
||||||
header: { marginBottom: 20 },
|
header: { marginBottom: 20 },
|
||||||
grid: { display: "grid", gridTemplateColumns: "1fr 1fr", alignItems: "start", gap: 40 },
|
grid: { display: "grid", gridTemplateColumns: "1fr 1fr", alignItems: "start", gap: 40 },
|
||||||
formContainer: {
|
formContainer: {},
|
||||||
marginTop: 12,
|
|
||||||
},
|
|
||||||
instructionsContainer: {
|
instructionsContainer: {
|
||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
padding: 15,
|
padding: 15,
|
||||||
|
|
|
@ -18,9 +18,11 @@ const useStyles = makeStyles((theme) => {
|
||||||
height: "auto !important",
|
height: "auto !important",
|
||||||
},
|
},
|
||||||
listItemActive: {
|
listItemActive: {
|
||||||
border: `1px solid ${theme.palette.grey.A100}`,
|
background: "#f4f4f4",
|
||||||
|
borderRadius: 4,
|
||||||
|
overflow: "hidden",
|
||||||
},
|
},
|
||||||
cellSlug: {
|
channelSlug: {
|
||||||
fontFamily: "monospace",
|
fontFamily: "monospace",
|
||||||
opacity: 0.8,
|
opacity: 0.8,
|
||||||
},
|
},
|
||||||
|
@ -38,6 +40,11 @@ export const ChannelsList = ({ channels, activeChannelSlug, onChannelClick }: Pr
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OffsettedList gridTemplate={["1fr"]}>
|
<OffsettedList gridTemplate={["1fr"]}>
|
||||||
|
<OffsettedListHeader>
|
||||||
|
<Typography variant="h3" paragraph>
|
||||||
|
Available channels
|
||||||
|
</Typography>
|
||||||
|
</OffsettedListHeader>
|
||||||
<OffsettedListBody>
|
<OffsettedListBody>
|
||||||
{channels.map((c) => {
|
{channels.map((c) => {
|
||||||
return (
|
return (
|
||||||
|
@ -52,8 +59,8 @@ export const ChannelsList = ({ channels, activeChannelSlug, onChannelClick }: Pr
|
||||||
>
|
>
|
||||||
<OffsettedListItemCell>
|
<OffsettedListItemCell>
|
||||||
{c.name}
|
{c.name}
|
||||||
<Typography variant="caption">
|
<Typography variant="caption" className={styles.channelSlug}>
|
||||||
<code>{c.slug}</code>
|
{c.slug}
|
||||||
</Typography>
|
</Typography>
|
||||||
</OffsettedListItemCell>
|
</OffsettedListItemCell>
|
||||||
</OffsettedListItem>
|
</OffsettedListItem>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import "@saleor/apps-shared/src/globals.css";
|
import "@saleor/apps-shared/src/globals.css";
|
||||||
|
import "../styles/globals.css";
|
||||||
import { AppBridge, AppBridgeProvider } from "@saleor/app-sdk/app-bridge";
|
import { AppBridge, AppBridgeProvider } from "@saleor/app-sdk/app-bridge";
|
||||||
import { RoutePropagator } from "@saleor/app-sdk/app-bridge/next";
|
import { RoutePropagator } from "@saleor/app-sdk/app-bridge/next";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
|
|
|
@ -2,15 +2,8 @@ body {
|
||||||
font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
|
font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
|
||||||
"Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
"Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
||||||
color: #111;
|
color: #111;
|
||||||
padding: 1rem 2rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
a {
|
||||||
background: #f6f8fa;
|
cursor: pointer;
|
||||||
border: 1px solid #eaeaea;
|
|
||||||
border-radius: 5px;
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0.1em 0.2em;
|
|
||||||
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
|
||||||
Bitstream Vera Sans Mono, Courier New, monospace;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue