Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
[Front | FlexScreen] Banner | GalleryCard | Product - [Front] Footer …
Browse files Browse the repository at this point in the history
…Padding (#78)

* [Front | FlexScreen] Banner | GalleryCard | Product

* Update Footer component styles

* Add padding to Footer component
  • Loading branch information
Aloento authored Jan 29, 2024
1 parent 174004b commit 727ecea
Show file tree
Hide file tree
Showing 9 changed files with 228 additions and 233 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"update": "npx npm-check-updates -u"
},
"dependencies": {
"@fluentui/react-components": "^9.46.1",
"@fluentui/react-components": "^9.46.2",
"@fluentui/react-hooks": "^8.6.36",
"@fluentui/react-icons": "^2.0.226",
"@griffel/react": "^1.5.20",
Expand All @@ -35,7 +35,7 @@
"@lexical/utils": "0.10.0",
"@microsoft/signalr": "^8.0.0",
"@microsoft/signalr-protocol-msgpack": "^8.0.0",
"ahooks": "^3.7.8",
"ahooks": "^3.7.9",
"dayjs": "^1.11.10",
"dexie": "^3.2.4",
"dexie-react-hooks": "^1.1.7",
Expand Down
344 changes: 165 additions & 179 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/Components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import { ColFlex, Flex, NavW } from "~/Helpers/Styles";
/**
* @author Aloento
* @since 0.1.0
* @version 0.1.2
* @version 0.1.3
*/
const useStyles = makeStyles({
box: {
width: "-webkit-fill-available",
marginTop: tokens.spacingVerticalXXXL,
...shorthands.padding(tokens.spacingVerticalXXL, 0),
paddingTop: tokens.spacingVerticalXXL,
paddingBottom: tokens.spacingVerticalL,
paddingLeft: tokens.spacingHorizontalXXXL,
paddingRight: tokens.spacingHorizontalXXXL,
backgroundColor: tokens.colorNeutralBackgroundStatic
},
main: {
Expand Down
16 changes: 12 additions & 4 deletions src/Pages/Gallery/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ColFlex, Cover, Flex } from "~/Helpers/Styles";
/**
* @author Aloento
* @since 1.3.5
* @version 0.1.0
* @version 0.2.0
*/
const useStyles = makeStyles({
main: {
Expand All @@ -16,6 +16,7 @@ const useStyles = makeStyles({
...Cover,
aspectRatio: "42/9",
width: "100%",
minHeight: "320px",
...shorthands.borderRadius(tokens.borderRadiusXLarge),
},
mask: {
Expand All @@ -36,14 +37,21 @@ const useStyles = makeStyles({
},
space: {
flexBasis: "50%",
flexShrink: 0
flexShrink: 0,
"@media screen and (max-width: 1024px)": {
flexBasis: 0,
}
},
txt: {
...ColFlex,
justifyContent: "space-around"
},
white: {
color: "white !important"
color: "white !important",
"@media screen and (max-width: 600px)": {
fontSize: tokens.fontSizeBase300,
lineHeight: tokens.lineHeightBase300,
}
}
});

Expand Down Expand Up @@ -99,7 +107,7 @@ export function Banner() {
</LargeTitle>
</div>

<Text size={500} className={style.white}>
<Text size={500} truncate className={style.white}>
We offer an exclusive chance for OTC tribe members to get up to three fashion items until February 29, 2024.
Members can log in using their OTC-LDAP account, update their delivery address in the "Settings," and shop for their preferred styles.
After selecting items and sizes, confirm and submit their order and address.
Expand Down
10 changes: 3 additions & 7 deletions src/Pages/Gallery/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ import { Hub } from "~/ShopNet";
/**
* @author Aloento
* @since 0.1.0
* @version 0.1.0
* @version 0.2.0
*/
const useStyles = makeStyles({
card: {
flexBasis: "23%",
flexGrow: 0,
},
img: {
aspectRatio: "1",
...Cover,
Expand All @@ -28,7 +24,7 @@ const log = new Logger("Gallery", "Category", "Card");
/**
* @author Aloento
* @since 0.5.0
* @version 0.1.5
* @version 0.1.6
*/
export function GalleryCard({ Id }: { Id: number }) {
const style = useStyles();
Expand All @@ -37,7 +33,7 @@ export function GalleryCard({ Id }: { Id: number }) {
});

return (
<Card className={style.card}>
<Card>
<CardPreview>
<GuidImage className={style.img} Guid={data?.Cover} Log={log} />
</CardPreview>
Expand Down
27 changes: 15 additions & 12 deletions src/Pages/Gallery/Category.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { SkeletonItem, Title3, makeStyles, tokens } from "@fluentui/react-components";
import { useRequest } from "ahooks";
import { random } from "lodash-es";
import { Logger } from "~/Helpers/Logger";
import { Flex } from "~/Helpers/Styles";
import { Hub } from "~/ShopNet";
Expand All @@ -9,18 +8,22 @@ import { GalleryCard } from "./Card";
/**
* @author Aloento
* @since 0.1.0
* @version 0.1.0
* @version 0.2.0
*/
const useStyles = makeStyles({
card: {
flexBasis: "23%",
flexGrow: 0,
flexBasis: "20%",
flexGrow: 1,
flexShrink: 0,
maxWidth: "25%",
minWidth: `${375 / 2}px`,
boxSizing: "border-box",
paddingRight: tokens.spacingHorizontalL,
paddingLeft: tokens.spacingHorizontalL,
},
cate: {
...Flex,
flexWrap: "wrap",
justifyContent: "space-evenly",
columnGap: tokens.spacingVerticalL,
rowGap: tokens.spacingVerticalXL
}
});
Expand All @@ -30,7 +33,7 @@ const log = new Logger("Gallery", "Category");
/**
* @author Aloento
* @since 0.5.0
* @version 0.1.4
* @version 0.1.5
*/
export function GalleryCategory({ Category }: { Category: string }) {
const style = useStyles();
Expand All @@ -45,11 +48,11 @@ export function GalleryCategory({ Category }: { Category: string }) {
{
loading
? <SkeletonItem size={128} />
: data![0].map((x, i) => <GalleryCard key={i} Id={x} />)
.concat(
Array(data![1]).fill(null)
.map((_, i) => <div key={i + random(10, 100)} className={style.card} />)
)
: data!.map((x, i) => (
<div className={style.card}>
<GalleryCard key={i} Id={x} />
</div>
))
}
</div>
</>
Expand Down
41 changes: 22 additions & 19 deletions src/Pages/Product/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ import { ProductRadioList } from "./RadioList";
/**
* @author Aloento
* @since 0.1.0
* @version 0.1.0
* @version 0.2.0
*/
const useStyles = makeStyles({
main: ColFlex,
info: {
...Flex,
columnGap: tokens.spacingHorizontalXXXL
columnGap: tokens.spacingHorizontalXXXL,
"@media screen and (max-width: 600px)": {
flexWrap: "wrap",
}
},
detail: {
...BaseCard,
Expand All @@ -38,6 +40,9 @@ const useStyles = makeStyles({
flexBasis: "50%",
flexShrink: 0,
rowGap: tokens.spacingVerticalXL,
"@media screen and (max-width: 600px)": {
flexBasis: "100%",
}
},
fore: {
color: tokens.colorBrandForeground1
Expand All @@ -59,7 +64,7 @@ const log = new Logger("Product");
/**
* @author Aloento
* @since 0.1.0
* @version 0.3.0
* @version 0.3.1
*/
function Product() {
const style = useStyles();
Expand All @@ -82,27 +87,25 @@ function Product() {
<title>{data?.Name || ""} - {Dic.Name}</title>
</Helmet>

<div className={style.main}>
<div className={style.info}>
<ProductCarousel Id={id} />
<div className={style.info}>
<ProductCarousel Id={id} />

<div className={style.lex}>
<div className={style.detail}>
<LargeTitle className={style.fore}>
{data?.Name || "Loading..."}
</LargeTitle>
<div className={style.lex}>
<div className={style.detail}>
<LargeTitle className={style.fore}>
{data?.Name || "Loading..."}
</LargeTitle>

<Divider />
<Divider />

<ProductRadioList ProdId={id} />
<ProductRadioList ProdId={id} />

<Divider />
<Divider />

<ProductQuantity Id={id} />
</div>

<ProductLexicalRender ProdId={id} />
<ProductQuantity Id={id} />
</div>

<ProductLexicalRender ProdId={id} />
</div>
</div>
</RadioGroupContext>
Expand Down
2 changes: 1 addition & 1 deletion src/Pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NotFound } from "./404";
const useStyles = makeStyles({
body: {
...ColFlex,
minWidth: "1440px",
minWidth: "375px",
position: "absolute",
marginTop: `${NavH}px`,
width: "100%",
Expand Down
10 changes: 3 additions & 7 deletions src/ShopNet/Gallery/Get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ export abstract class GalleryGet extends ShopNet {
/**
* @author Aloento
* @since 0.5.0
* @version 0.2.1
* @version 0.2.2
*/
public static async Products(category: string): Promise<[number[], number]> {
public static async Products(category: string): Promise<number[]> {
const nums = await this.GetTimeCache<number[]>(category, "GalleryGetProducts", (x) => x.add(1, "m"), category);

return [
nums,
4 - (nums.length % 4)
];
return nums;
}
}

0 comments on commit 727ecea

Please sign in to comment.