Skip to content

feat: event card #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions site/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default function RootLayout({
return (
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style jsx global>{`
html {
font-family: ${font.style.fontFamily};
Expand Down
244 changes: 43 additions & 201 deletions site/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,208 +1,50 @@
"use client";
import Button from "@components/ui/Button";
import { Camera } from "react-feather";
import Input, { Rounded, Size, Variant } from "@components/ui/Input";
import MultiSelect from "@components/ui/MultiSelect";
import Select from "@components/ui/Select";
import Switch from "@components/Switch";
import Checkbox from "@components/ui/Checkbox";
import Radio from "@components/ui/Radio";
import EventCard from "@components/ui/EventCard";
import { Swiper, SwiperSlide } from "swiper/react";
import TitleBar from "@components/ui/TitleBar";
import SwiperCore, { Mousewheel, Virtual } from "swiper";
import React, { useState } from "react";
import "swiper/css";
export default function Page() {
const [autoCompleteValue, setautoCompleteValue] = useState<string>();
const [multiValues, setmultiValues] = useState<any>([]);
const [checked, setchecked] = useState(false);
const [variantvalue, setVariantValue] = useState<Variant>("normal");
const [radiusValue, setRadiusValue] = useState<Rounded>("sm");
const [sizeValue, SetSizeValue] = useState<Size>("md");
const [isDisabledValue, setIsDisabledValue] = useState(false);
const [isInvalid, SetIsInvalidValue] = useState(false);
const [buttonVariant, setButtonVariant] = useState<any>("normal");
const [buttonSizeValue, setButtonSizeValue] = useState<Size>("md");
const [buttonRadiusValue, setButtonRadiusValue] = useState<Rounded>("sm");
const [isDisabledButton, setIsDisabledButton] = useState(false);
const [isCompact, setIsCompact] = useState(false);
const [isLoadingButton, setIsLoadingButton] = useState(false);
const [isUppercase, setIsUppercase] = useState(false);
SwiperCore.use([Mousewheel, Virtual]);
return (
<div>
<div className="w-2/5 space-y-10 p-5 border-b mt-10">
<Input
label="lable"
type="email"
rounded={radiusValue}
disabled={isDisabledValue}
invalid={isInvalid}
size={sizeValue}
variant={variantvalue}
errorMsg="*Description of the error"
placeholder="Add placeholder"
/>
<div className="flex gap-4 flex-wrap">
<Select
creatable
onChange={setVariantValue}
value={variantvalue}
label="Variant"
placeholder="Input's Variant"
data={["normal", "fill", "outlined"]}
/>
<Select
creatable
onChange={setRadiusValue}
value={radiusValue}
label="Radius"
placeholder="Input's Radius"
data={["sm", "md", "lg", "full", "none"]}
/>
<Select
creatable
onChange={SetSizeValue}
value={sizeValue}
label="Size"
placeholder="Input's Size"
data={["sm", "md", "lg"]}
/>
<div className="flex gap-2 my-auto">
<Switch
onChange={() => {
setIsDisabledValue(!isDisabledValue);
}}
label="Disabled"
/>
<Switch
onChange={() => {
SetIsInvalidValue(!isInvalid);
}}
label="Invalid"
/>
</div>
</div>
<div></div>
</div>
<div className="w-3/5 space-y-10 p-5 border-b mt-10">
<div className="flex gap-5">
<Button LeftIcon={Camera}>Hello</Button>
<Button RightIcon={Camera}>Hello</Button>
<Button href="google.com" size="md">
Link
</Button>
<Button
variant={buttonVariant}
size={buttonSizeValue}
loading={isLoadingButton}
rounded={buttonRadiusValue}
compact={isCompact}
uppercase={isUppercase}
disabled={isDisabledButton}
>
Hello
</Button>
</div>
<div className="flex gap-4 flex-wrap">
<Select
creatable
onChange={setButtonVariant}
value={buttonVariant}
label="Variant"
placeholder="Button's Variant"
data={[
"normal",
"outlined",
"primary",
"danger",
"success",
"light",
"subtle",
]}
/>
<Select
creatable
onChange={setButtonRadiusValue}
value={buttonRadiusValue}
label="Radius"
placeholder="Button's Radius"
data={["sm", "md", "lg", "full", "none"]}
/>
<Select
creatable
onChange={setButtonSizeValue}
value={buttonSizeValue}
label="Size"
placeholder="Button's Size"
data={["sm", "md", "lg"]}
/>
<div className="flex gap-2 my-auto flex-wrap">
<Switch
onChange={() => {
setIsDisabledButton(!isDisabledButton);
}}
label="Disabled button"
/>
<Switch
onChange={() => {
setIsCompact(!isCompact);
}}
label="Compact"
/>
<Switch
onChange={() => {
setIsLoadingButton(!isLoadingButton);
}}
label="Loading..."
/>
<Switch
onChange={() => {
setIsUppercase(!isUppercase);
}}
label="Uppercase"
/>
</div>
</div>
<div></div>
</div>
<div className="my-6">
<MultiSelect
onChange={setmultiValues}
values={multiValues}
label="Pick a framework"
creatable
maxSelectedValues={2}
placeholder="Pick all that you like"
data={[
{ value: "React", label: "React" },
{ value: "Angular", label: "Angular" },
{ value: "Svelte", label: "Svelte" },
{ value: "Vue", label: "Vue" },
]}
/>
</div>
<div>
<div className="m-5">
<Radio
checked={true}
onChange={() => {}}
label="How is the gym training"
/>
<Radio label="What is andela" onChange={() => {}} />
</div>
<div className="m-5">
<Checkbox
checked={checked}
onChange={() => {
setchecked(!checked);
}}
label="Click me to change the selected"
/>
</div>
<div className="my-10 mx-5">
<Switch
onChange={() => {}}
title="Available to hire"
subTitle="Nulla amet tempus sit accumsan. Aliquet turpis sed sit lacinia."
/>
<Switch onChange={() => {}} label="Aliquet turpis sed sit lacinia." />
</div>
<div className="max-w-7xl mx-auto">
<TitleBar title={"Trending Upcomming Events"} />
<div className="mt-5">
<Swiper
breakpoints={{
340: {
slidesPerView: 1.2,
spaceBetween: 10,
},
640: {
slidesPerView: 2,
spaceBetween: 10,
},
768: {
slidesPerView: 3,
spaceBetween: 25,
},
1024: {
slidesPerView: 4,
spaceBetween: 20,
},
}}
direction={"horizontal"}
mousewheel={{
forceToAxis: true,
sensitivity: -10,
thresholdDelta: 14,
}}
>
{Array(8)
.fill(0)
.map((_, i) => (
<SwiperSlide key={i}>
<EventCard key={i} />
</SwiperSlide>
))}
</Swiper>
</div>
</div>
);
Expand Down
59 changes: 59 additions & 0 deletions site/components/ui/EventCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import Image from "next/image";
import React from "react";
import { Zap } from "react-feather";
export default function EventCard() {
return (
<div className="bg-gray-700 rounded-md overflow-hidden">
<div className="rounded-md overflow-hidden m-2 relative">
<Image
className="w-full h-full object-cover"
src={"/assets/img/event-1.png"}
width={378}
height={231}
alt=""
/>
<div className="h-full absolute w-full flex top-0 group items-center justify-center cursor-pointer">
<button className="bg-white flex gap-2 py-2 px-3 transition-all delay-150 rounded-full items-center opacity-0 group-hover:opacity-100">
<Zap fill="#503ae7" size={20} stroke="#503ae7" />
<span>Details</span>
</button>
</div>
</div>
<div className="flex justify-between mt-6 mb-4 text-xl font-semibold text-white px-5">
<h3>Oslo</h3>
<h3>Google</h3>
</div>
<div className="flex gap-12 mb-4 text-sm font-semibold text-white text-opacity-70 w-fit px-5">
<span className="uppercase text-primary-200">van</span>
<span className="uppercase">NYC</span>
<span className="uppercase">NYC</span>
<span className="uppercase">van</span>
</div>
<div className="bg-gray-600 px-5 py-3 text-white flex items-center justify-between">
<p className="font-semibold">
9:40 AM <span className="text-white text-opacity-70">08 DEC</span>
</p>
<div className="flex items-center">
<div className="w-8 h-8 border-[3px] rounded-full">
<Image
className="object-cover rounded-full w-full h-full"
src={"/assets/img/event-1.png"}
width={30}
height={30}
alt=""
/>
</div>
<div className="w-8 h-8 -ml-2 border-[3px] rounded-full">
<Image
className="object-cover rounded-full w-full h-full"
src={"/assets/img/event-1.png"}
width={30}
height={30}
alt=""
/>
</div>
</div>
</div>
</div>
);
}
14 changes: 14 additions & 0 deletions site/components/ui/TitleBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
interface props {
title: string;
}
export default function TitleBar({ title }: props) {
return (
<div className="flex justify-between items-center">
<h3 className="text-xl font-semibold text-white">{title}</h3>
<h4 className="text-md font-bold cursor-pointer text-primary-200">
View More
</h4>
</div>
);
}
1 change: 1 addition & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-feather": "^2.0.10",
"swiper": "^8.4.6",
"typescript": "4.8.4"
},
"devDependencies": {
Expand Down
Binary file added site/public/assets/img/event-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/public/assets/img/event-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions site/public/assets/img/icon/1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions site/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
DEFAULT: "#6271EB",
50: "#2B2D3D",
100: "#242634",
200: "#503ae7",
},
light: "#A8A8A8",
gray: {
Expand Down
20 changes: 20 additions & 0 deletions site/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,13 @@ doctrine@^3.0.0:
dependencies:
esutils "^2.0.2"

dom7@^4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/dom7/-/dom7-4.0.4.tgz#8b68c5d8e5e2ed0fddb1cb93e433bc9060c8f3fb"
integrity sha512-DSSgBzQ4rJWQp1u6o+3FVwMNnT5bzQbMb+o31TjYYeRi05uAcpF8koxdfzeoe5ElzPmua7W7N28YJhF7iEKqIw==
dependencies:
ssr-window "^4.0.0"

electron-to-chromium@^1.4.251:
version "1.4.284"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592"
Expand Down Expand Up @@ -1825,6 +1832,11 @@ source-map-js@^1.0.2:
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==

ssr-window@^4.0.0, ssr-window@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-4.0.2.tgz#dc6b3ee37be86ac0e3ddc60030f7b3bc9b8553be"
integrity sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==

string.prototype.matchall@^4.0.7:
version "4.0.7"
resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz#8e6ecb0d8a1fb1fda470d81acecb2dba057a481d"
Expand Down Expand Up @@ -1893,6 +1905,14 @@ supports-preserve-symlinks-flag@^1.0.0:
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==

swiper@^8.4.6:
version "8.4.6"
resolved "https://registry.yarnpkg.com/swiper/-/swiper-8.4.6.tgz#5b52c83cb4aa9ce6f1640e44d3f93ff4ea6f7682"
integrity sha512-HACW035vBz2T6Kfut23EAzXhcDpgR8doX+wjq0ZUvJgS5SQApGrV885DAPLBFnmPUISsAhNSVxPKDxqroFvXvQ==
dependencies:
dom7 "^4.0.4"
ssr-window "^4.0.2"

tailwindcss@^3.2.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.2.2.tgz#705f78cec8f4de2feb52abdb7a8a056e67f2d736"
Expand Down