Skip to content

Commit b4c180f

Browse files
committed
feat(home heading)
1 parent 54bb65e commit b4c180f

File tree

6 files changed

+46
-34
lines changed

6 files changed

+46
-34
lines changed

app/globals.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@
4545
}
4646

4747
@layer utilities {
48+
.text-40 {
49+
@apply text-2xl md:text-3xl xl:text-4xl font-bold;
50+
}
51+
52+
.text-28 {
53+
@apply text-[20px] md:text-[28px];
54+
}
55+
56+
.text-20 {
57+
@apply text-sm md:text-[20px];
58+
}
59+
4860
.btn-global {
4961
@apply transition-colors flex items-center justify-center gap-2 font-medium duration-200 min-h-[38px] sm:h-9 rounded-lg py-1 px-4 md:px-5 text-sm;
5062
}

app/page.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1+
import CButton from "@/components/shared/CButton";
2+
13
export default function Page() {
24
return (
3-
<div className="max-w-[1400px] mx-auto px-5 flex flex-col justify-center gap-4 h-dvh">
4-
hello
5+
<div className="max-w-[1000px] mx-auto px-5 flex flex-col justify-center gap-4 h-dvh">
6+
<h1 className="text-40">UI Dash</h1>
7+
<p className="text-20">Just a simple dashboard ui for your starter:)</p>
8+
<div className="flex gap-4 items-center pt-5">
9+
<CButton title="See Example" href="/v1" />
10+
<CButton
11+
title="View Github"
12+
href="https://github.com/zedd-dev/ui-dash"
13+
newWindow
14+
/>
15+
</div>
516
</div>
617
);
718
}

components/shared/CButton.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Link from "next/link";
2+
import styles from "@/styles/component/button.module.css";
3+
import { cn } from "@/lib/utils";
4+
5+
export default function CButton({ title, href,newWindow }: any) {
6+
return href ? (
7+
<Link href={href} target={newWindow ? "_blank" : "_self"} className={cn(styles.container, styles.default)}>
8+
{title}
9+
</Link>
10+
) : (
11+
<button className={cn(styles.container, styles.default)}>{title}</button>
12+
);
13+
}

hooks/index.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -66,33 +66,6 @@ export function useScrollX() {
6666
}, []);
6767
}
6868

69-
export const useCheckPosition = (
70-
setPosition: (position: "top" | "bottom") => void,
71-
REF: React.RefObject<HTMLDivElement>,
72-
isActive: boolean,
73-
) => {
74-
const check = () => {
75-
const RECT = REF.current?.getBoundingClientRect();
76-
if (!RECT) return;
77-
78-
const SPACE_ABOVE = RECT.top;
79-
const SPACE_BELOW = window.innerHeight - RECT.bottom;
80-
const HEIGHT = 200;
81-
82-
if (SPACE_BELOW >= HEIGHT || SPACE_BELOW >= SPACE_ABOVE) {
83-
setPosition("bottom");
84-
} else {
85-
setPosition("top");
86-
}
87-
};
88-
89-
useEffect(() => {
90-
check();
91-
window.addEventListener("resize", check);
92-
return () => window.removeEventListener("resize", check);
93-
}, [isActive]);
94-
};
95-
9669
export const useDisableScroll = (isOpen: boolean) => {
9770
useEffect(() => {
9871
if (isOpen) {

next.config.mjs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {
3-
images: {
4-
domains: ["source.unsplash.com","picsum.photos","via.placeholder.com"],
5-
}
6-
};
2+
const nextConfig = {};
73

84
export default nextConfig;

styles/component/button.module.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.container {
2+
@apply text-base font-semibold rounded-lg px-4 py-2;
3+
}
4+
5+
.default {
6+
@apply border border-l-4 border-b-4 border-light-300 text-light-300 hover:scale-105 transition-all duration-300;
7+
}

0 commit comments

Comments
 (0)