Skip to content

Commit

Permalink
feat: page container layout, feature options added
Browse files Browse the repository at this point in the history
  • Loading branch information
yashsehgal committed Oct 4, 2023
1 parent 153ddfc commit 23ddc9e
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 10 deletions.
14 changes: 8 additions & 6 deletions app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import PageContent from "@/components/layouts/page-content";
import DashboardFeatureList from "@/components/sections/dashboard-features-list";
import DashboardRecentActivity from "@/components/sections/dashboard-recent-activity";
import TopicSuggestions from "@/components/sections/topic-suggestions";
import StatusAlert from "@/components/ui/status-alert";

const Dashboard: React.FunctionComponent = () => {
return (
<div className="dashboard">
<DashboardFeatureList />
<DashboardRecentActivity />
<TopicSuggestions />
</div>
<PageContent>
<div className="dashboard grid grid-cols-1 gap-20">
<DashboardFeatureList />
{/* <DashboardRecentActivity /> */}
{/* <TopicSuggestions /> */}
</div>
</PageContent>
)
}
export default Dashboard;
5 changes: 5 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@

h1, h2, h3, h4 {
@apply tracking-tight;
}

.hide-scrollbar::-webkit-scrollbar {
width: 0; /* Remove scrollbar space */
background: transparent; /* Optional: just make scrollbar invisible */
}
10 changes: 7 additions & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import PageContent from "@/components/layouts/page-content";
import ViewContainer from "@/components/layouts/view-container";
import StatusAlert from "@/components/ui/status-alert";

const App: React.FunctionComponent = () => {
return (
<div className="app m-12">
<StatusAlert />
</div>
<PageContent>
<ViewContainer>
<StatusAlert />
</ViewContainer>
</PageContent>
)
}

Expand Down
15 changes: 15 additions & 0 deletions components/layouts/page-content.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { cn } from "@/lib/utils"

const PageContent: React.FunctionComponent<React.HTMLAttributes<HTMLDivElement>> = ({
className,
children,
...props
}) => {
return (
<div className={cn("page-content my-10", className)} {...props}>
{children}
</div>
)
};

export default PageContent;
37 changes: 36 additions & 1 deletion components/sections/dashboard-features-list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,43 @@
import ViewContainer from "@/components/layouts/view-container";
import FeatureOption from "@/components/ui/feature-option";
import { Video } from "lucide-react";

const FeatureList: Array<FeatureOptionInterface> = [

This comment has been minimized.

Copy link
@shristigupta12

shristigupta12 Oct 10, 2023

Collaborator

since this data of FeatureList is always going to be static, can we add it in the common folder instead of writing here?

This comment has been minimized.

Copy link
@yashsehgal

yashsehgal Oct 11, 2023

Author Owner

Yeah sure, that's a better way 👍🏽 Go for this change in the #20 PR itself.

{
featureName: "Video Interview",
icon: <Video />
},
{
featureName: "ATS Resume Review",
},
{
featureName: "Topic Based Q/A"
},
{
featureName: "Mock Aptitude"
},
{
featureName: "Behavioural Rounds"
},
]

const DashboardFeatureList: React.FunctionComponent = () => {
return (
<section className="dashboard-features-list">
{"DashboardFeatureList"}
<ViewContainer>
<h3 className="text-lg font-semibold">
{"Start new activity"}
</h3>
<div className="features-list-container mt-3 flex flex-row gap-4 overflow-x-scroll hide-scrollbar">
{FeatureList.map((featureItem, featureIndex) => (
<FeatureOption
featureName={featureItem.featureName}
icon={featureItem.icon}
key={featureIndex}
/>
))}
</div>
</ViewContainer>
</section>
)
}
Expand Down
23 changes: 23 additions & 0 deletions components/ui/feature-option.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { cn } from "@/lib/utils"
import Link from "next/link"

const FeatureOption: React.FunctionComponent<FeatureOptionInterface> = ({
featureName,
icon,
className,
...props
}) => {
return (
<Link href={""}>
<div
className={cn("relative w-[240px] h-[140px] rounded-2xl border border-transparent bg-neutral-800 text-neutral-50 shadow hover:shadow-md transition-all")}
{...props}
>
{icon && <div className="absolute icon-wrapper top-4 right-4">{icon}</div>}
{<p className="absolute font-medium text-lg bottom-4 left-4">{featureName}</p>}
</div>
</Link>
)
}

export default FeatureOption;
10 changes: 10 additions & 0 deletions types/feature-option.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

declare interface FeatureOptionInterface extends React.HTMLAttributes<HTMLDivElement> {
featureName: "Video Interview"
| "ATS Resume Review"
| "Topic Based Q/A"
| "Mock Aptitude"
| "Behavioural Rounds"
;
icon?: React.ReactNode;
};

0 comments on commit 23ddc9e

Please sign in to comment.