Skip to content

Commit

Permalink
Merge pull request #14 from ivalshamkya/feat/card
Browse files Browse the repository at this point in the history
feat/card
  • Loading branch information
ivalshamkya authored Jan 25, 2024
2 parents 176cdb3 + a183604 commit c76957b
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 79 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ jobs:
Deploy-Preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
Expand Down
Binary file added public/aiko.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { Inter, IBM_Plex_Mono, Darker_Grotesque, Bricolage_Grotesque } from 'nex
import './globals.css'
import Navbar from '@/components/Navbar'

const inter = Inter({ subsets: ['latin'] })
const ibm = IBM_Plex_Mono({ subsets: ['latin'], weight: "500" })
const Grotesque = Darker_Grotesque({ subsets: ['latin'], weight: "500" })
const bricolage = Bricolage_Grotesque({ subsets: ['latin'] })
const inter = Inter({ subsets: ['latin'], display: 'swap', adjustFontFallback: false })
const ibm = IBM_Plex_Mono({ subsets: ['latin'], weight: "500", display: 'swap', adjustFontFallback: false })
const Grotesque = Darker_Grotesque({ subsets: ['latin'], weight: "500", display: 'swap', adjustFontFallback: false })
const bricolage = Bricolage_Grotesque({ subsets: ['latin'], display: 'swap', adjustFontFallback: false })

export const metadata: Metadata = {
title: 'NeoBruu',
Expand Down
19 changes: 0 additions & 19 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@
import Link from "next/link";
import { useEffect, useState } from "react";
import { AiFillGithub } from "react-icons/ai";
import { CgDarkMode, CgMoon, CgSun } from "react-icons/cg";
import { IoIosMoon, IoIosSunny } from "react-icons/io";
import { RiMoonClearFill } from "react-icons/ri";
import SearchBar from "./SearchBar";

function Navbar() {
const [theme, setTheme] = useState<string>("");
const [search, setSearch] = useState<string>("");

const handleClick = () => {
setTheme(theme === "light" ? "dark" : "light");
};

useEffect(() => {
setTheme((prev) => localStorage.getItem("theme") ?? "light");
Expand All @@ -41,17 +33,6 @@ function Navbar() {
>
<AiFillGithub className="h-6 w-6 text-white" />
</a>
{/* <button
type="button"
onClick={handleClick}
className="flex items-center justify-center rounded-md border border-black p-2 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] shadow-orange-400/40 transition-all hover:translate-x-[3px] hover:translate-y-[3px] hover:shadow-none dark:border-zinc-600 dark:shadow-yellow-400/40"
>
{theme === "light" ? (
<IoIosSunny className="h-6 w-6 text-orange-400" />
) : (
<RiMoonClearFill className="h-6 w-6 text-yellow-400" />
)}
</button> */}
</div>
</div>
</nav>
Expand Down
5 changes: 3 additions & 2 deletions src/components/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Link from 'next/link';
import { useState, useEffect, ChangeEvent, useRef } from 'react';

import components from '@/data/components';
import { CgClose, CgSearch } from 'react-icons/cg';
import { MdAdd, MdKeyboardCommandKey } from "react-icons/md";
import components from '@/data/components'; // Update the path
import Link from 'next/link';
import { RxComponent1 } from "react-icons/rx";

type SearchBarProps = {};
Expand Down
3 changes: 1 addition & 2 deletions src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import { usePathname } from 'next/navigation';
import components from '@/data/components';
import Link from 'next/link';
import Badge from './neobruu/Badge';
import { metadata } from '@/app/layout';
import Badge from '@/components/neobruu/Badge';

export default function Sidebar() {
const pathname = usePathname();
Expand Down
3 changes: 1 addition & 2 deletions src/components/example/AlertExample.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Button from "@/components/neobruu/Button";
import Alert from "@/components/neobruu/Alert";
import { BsInfoCircleFill, BsExclamationTriangleFill } from "react-icons/Bs";
import { BsInfoCircleFill, BsExclamationTriangleFill } from "react-icons/bs";

export default function AlertExample() {
return (
Expand Down
11 changes: 7 additions & 4 deletions src/components/example/CardExample.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { Card } from "@/components/neobruu/Card";
import Button from "../neobruu/Button";
import Card from "@/components/neobruu/Card";
import Button from "@/components/neobruu/Button";

export default function CardExample() {
return (
<div className="flex gap-3">
<Card rounded="none">
<Card.Header imageUrl="https://picsum.photos/200.webp" />
<Card.Header imageUrl="/aiko.jpeg" />
<Card.Body>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Praesentium rem cum nisi molestiae voluptatibus nemo eaque doloremque tempora incidunt laborum! Obcaecati ipsum ducimus ad aliquid cum delectus adipisci ratione dolores.
<h1 className="text-2xl font-bold mb-2">Aiko 🐈</h1>
<p className="line-clamp-4">
Meet the orange cat, a charismatic furball with a coat as vibrant as a summer sunset. This feline fashionista proudly dons a luxurious fur ensemble in various shades of citrus, making every day a catwalk. With eyes that sparkle like the juiciest mandarin, this orange fluff-master struts through life, leaving a trail of paw prints and a lingering scent of sunshine. Known for stealing hearts faster than you can peel an orange, this cat is the ultimate blend of mischief and zest, making it the purrfect companion for anyone in need of a daily dose of Vitamin Cuteness. 🍊😺
</p>
</Card.Body>
<Card.Footer>
<Button>Read More</Button>
Expand Down
1 change: 0 additions & 1 deletion src/components/example/TabsExample.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client'
import Tabs from '@/components/neobruu/Tabs';


export default function TabsExample() {

return (
Expand Down
2 changes: 0 additions & 2 deletions src/components/example/ToastExample.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use client'

import Toast from "@/components/neobruu/Toast";
import Button from "../neobruu/Button";
import { useState } from "react";

export default function ToastExample() {
Expand Down
65 changes: 35 additions & 30 deletions src/components/neobruu/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Image from "next/image";

type CardProps = {
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
children: React.ReactNode
Expand All @@ -15,40 +17,43 @@ type CardBodyProps = {
children: React.ReactNode;
};

export const Card: React.FC<CardProps> & {
Header: React.FC<CardHeaderProps>;
Footer: React.FC<CardFooterProps>;
Body: React.FC<CardBodyProps>;
} = ({ rounded = 'none', children }) => {
function Card({ rounded = 'none', children }: CardProps) {
return (
<div className={`w-[350px] h-full border-black border-2 rounded-${rounded} shadow-[8px_8px_0px_rgba(0,0,0,1)] bg-white`}>
{children}
</div>
);
};

Card.Header = ({ imageUrl }) => (
<a href="" className="block cursor-pointer h-[250px]">
<article className="w-full h-[250px]">
<figure className="w-full h-[250px] border-black border-b-2">
<img
src={imageUrl}
alt="thumbnail"
className="w-full h-full object-cover"
/>
</figure>
</article>
</a>
);

Card.Footer = ({ children }) => (
<div className="px-6 py-5 text-left h-full">
{children}
</div>
);

Card.Body = ({ children }) => (
<div className="px-6 py-5 text-left h-full">
{children}
</div>
);
Card.Header = function CardHeader({ imageUrl }: CardHeaderProps) {
return (
<a href="" className="relative block cursor-pointer h-[300px]">
<article className="w-full h-[300px]">
<figure className="w-full h-[300px] border-black border-b-2">
<Image
src={imageUrl}
alt="thumbnail"
fill={true}
/>
</figure>
</article>
</a>
);
}
Card.Footer = function CardFooter({ children }: CardFooterProps) {
return (
<div className="px-6 py-5 text-left h-full">
{children}
</div>
);
}

Card.Body = function CardBody({ children }: CardBodyProps) {
return (
<div className="px-6 py-5 text-justify h-full">
{children}
</div>
);
}

export default Card;
25 changes: 13 additions & 12 deletions src/data/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Alert from '@/components/neobruu/Alert'
import Avatar from '@/components/neobruu/Avatar'
import Button from '@/components/neobruu/Button'
import Badge from '@/components/neobruu/Badge'
import { Card } from '@/components/neobruu/Card'
import Card from '@/components/neobruu/Card'
import Checkbox from '@/components/neobruu/Checkbox'
import Dropdown from '@/components/neobruu/Dropdown'
import Input from '@/components/neobruu/Input'
Expand Down Expand Up @@ -37,7 +37,7 @@ type ComponentObj = {
const components: ComponentObj[] = [
{
name: 'Button',
sub: 'button',
sub: 'Lorem ipsum dolor sit amet, consectetur',
component: Button,
exampleComponent: ButtonExample,
prevComponent: 'Badge',
Expand All @@ -46,7 +46,7 @@ const components: ComponentObj[] = [

{
name: 'Toast',
sub: 'Toast',
sub: 'Lorem ipsum dolor sit amet, consectetur',
component: Toast,
exampleComponent: ToastExample,
prevComponent: 'Badge',
Expand All @@ -55,7 +55,7 @@ const components: ComponentObj[] = [

{
name: 'Alert',
sub: 'alert',
sub: 'Lorem ipsum dolor sit amet, consectetur',
component: Alert,
exampleComponent: AlertExample,
prevComponent: 'Badge',
Expand All @@ -64,6 +64,7 @@ const components: ComponentObj[] = [

{
name: 'Badge',
sub: 'Lorem ipsum dolor sit amet, consectetur',
component: Badge,
exampleComponent: BadgeExample,
prevComponent: 'Badge',
Expand All @@ -72,7 +73,7 @@ const components: ComponentObj[] = [

{
name: 'Checkbox',
sub: 'Checkbox',
sub: 'Lorem ipsum dolor sit amet, consectetur',
component: Checkbox,
exampleComponent: CheckboxExample,
prevComponent: 'Badge',
Expand All @@ -81,7 +82,7 @@ const components: ComponentObj[] = [

{
name: 'Avatar',
sub: 'Avatar',
sub: 'Lorem ipsum dolor sit amet, consectetur',
component: Avatar,
exampleComponent: AvatarExample,
prevComponent: 'Badge',
Expand All @@ -90,7 +91,7 @@ const components: ComponentObj[] = [

{
name: 'Tooltip',
sub: 'Tooltip',
sub: 'Lorem ipsum dolor sit amet, consectetur',
component: Tooltip,
exampleComponent: TooltipExample,
prevComponent: 'Badge',
Expand All @@ -99,7 +100,7 @@ const components: ComponentObj[] = [

{
name: 'Dropdown',
sub: 'Dropdown',
sub: 'Lorem ipsum dolor sit amet, consectetur',
component: Dropdown,
exampleComponent: DropdownExample,
prevComponent: 'Badge',
Expand All @@ -108,7 +109,7 @@ const components: ComponentObj[] = [

{
name: 'Tabs',
sub: 'Tabs',
sub: 'Lorem ipsum dolor sit amet, consectetur',
component: Tabs,
exampleComponent: TabsExample,
prevComponent: 'Badge',
Expand All @@ -117,7 +118,7 @@ const components: ComponentObj[] = [

{
name: 'Input',
sub: 'Displays a form input field or a component that looks like an input field.',
sub: 'Lorem ipsum dolor sit amet, consectetur',
component: Input,
exampleComponent: InputExample,
prevComponent: 'Badge',
Expand All @@ -126,7 +127,7 @@ const components: ComponentObj[] = [

{
name: 'Textarea',
sub: 'Displays a form textarea field or a component that looks like an textarea.',
sub: 'Lorem ipsum dolor sit amet, consectetur',
isNew: true,
component: Textarea,
exampleComponent: TextareaExample,
Expand All @@ -136,7 +137,7 @@ const components: ComponentObj[] = [

{
name: 'Card',
sub: 'Displays a form Card field or a component that looks like an Card.',
sub: 'Lorem ipsum dolor sit amet, consectetur',
isNew: true,
component: Card,
exampleComponent: CardExample,
Expand Down

0 comments on commit c76957b

Please sign in to comment.