Skip to content

Commit

Permalink
Merge pull request #253 from CivicDataLab/d4d
Browse files Browse the repository at this point in the history
D4d
  • Loading branch information
PixeledCode authored Oct 26, 2023
2 parents 5e193dd + 107404b commit dca5665
Show file tree
Hide file tree
Showing 54 changed files with 6,553 additions and 3,602 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const Content = ({ data }: { data: IProps }) => {

const breadcrumbs = [
{
label: 'Assam',
label: <Icon source={Icons.home} />,
href: '/',
},
{
Expand All @@ -118,7 +118,7 @@ export const Content = ({ data }: { data: IProps }) => {
backUrl={`/${data.district}/${data.department}`}
/>

<div className="mt-4">
<div className="mt-4 px-2 md:container py-1 lg:py-2">
<div className="flex gap-4 flex-wrap justify-start md:flex-nowrap">
<div className="flex">
<Image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,5 @@ export default async function Home({
chartData: getSchemeObject(chartData[params.district]).indicators,
};

return (
<div className="px-2 md:container py-1 lg:py-2">
<Content data={meta} />
</div>
);
return <Content data={meta} />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function Content({ data }: { data: IProps }) {

const breadcrumbs = [
{
label: 'Assam',
label: <Icon source={Icons.home} />,
href: '/',
},
{
Expand All @@ -58,65 +58,67 @@ export function Content({ data }: { data: IProps }) {
<>
<BreadCrumb backUrl={`/${data.district}`} crumbs={breadcrumbs} />

<Text variant="heading3xl" as="h1" color="subdued" className="mt-7">
{departmentData.deptTitle}
</Text>
<div div className="container py-1 lg:py-2">
<Text variant="heading3xl" as="h1" color="subdued" className="mt-7">
{departmentData.deptTitle}
</Text>

<div className="mt-6 bg-surfaceDefault rounded-05 shadow-elementCard">
<Collapsible defaultOpen>
<CollapsibleTrigger className={styles.CollapseTrigger}>
<Text variant="headingLg" as="h3">
{departmentData.collapsible.title}
<div className="mt-6 bg-surfaceDefault rounded-05 shadow-elementCard">
<Collapsible defaultOpen>
<CollapsibleTrigger className={styles.CollapseTrigger}>
<Text variant="headingLg" as="h3">
{departmentData.collapsible.title}
</Text>
<Icon source={Icons.down} />
</CollapsibleTrigger>

<CollapsibleContent className="pb-4 px-6">
<Separator />
<div className="mt-4 flex flex-col gap-3">
{departmentData.collapsible.content.map((item) => (
<Text key={item}>{item}</Text>
))}
</div>
</CollapsibleContent>
</Collapsible>
</div>

{departmentData.highlights && (
<div className="mt-6">
<Text variant="headingSmSpaced" color="subdued" as="h2">
{departmentData.highlights.title}
</Text>
<Icon source={Icons.down} />
</CollapsibleTrigger>

<CollapsibleContent className="pb-4 px-6">
<Separator />
<div className="mt-4 flex flex-col gap-3">
{departmentData.collapsible.content.map((item) => (
<Text key={item}>{item}</Text>
<div className="mt-3 flex gap-4 flex-wrap">
{departmentData.highlights.cards.map((card, index) => (
<ContentCard
key={card.label + index}
value={card.value}
label={card.label}
color={card.color}
/>
))}
</div>
</CollapsibleContent>
</Collapsible>
</div>

{departmentData.highlights && (
<div className="mt-6">
<Text variant="headingSmSpaced" color="subdued" as="h2">
{departmentData.highlights.title}
</Text>
</div>
)}

<div className="mt-3 flex gap-4 flex-wrap">
{departmentData.highlights.cards.map((card, index) => (
<ContentCard
key={card.label + index}
value={card.value}
label={card.label}
color={card.color}
<div className="mt-8">
<div className="flex gap-5 items-center justify-between flex-wrap">
<Text variant="headingLg" as="h3">
{departmentData.listTitle}
</Text>
<Search />
</div>
<Separator className="mt-3 mb-4" />
<div className="grid gap-4 lg:grid-cols-2">
{departmentData.list.map((item) => (
<SchemeCard
data={{ ...item, departmentHref: data.department }}
key={item.label}
/>
))}
</div>
</div>
)}

<div className="mt-8">
<div className="flex gap-5 items-center justify-between flex-wrap">
<Text variant="headingLg" as="h3">
{departmentData.listTitle}
</Text>
<Search />
</div>
<Separator className="mt-3 mb-4" />
<div className="grid gap-4 lg:grid-cols-2">
{departmentData.list.map((item) => (
<SchemeCard
data={{ ...item, departmentHref: data.department }}
key={item.label}
/>
))}
</div>
</div>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,5 @@ export default async function Home({
departmentData: districtObj['depts'][params.department],
};

return (
<div className="container py-1 lg:py-2">
<Content data={meta} />
</div>
);
return <Content data={meta} />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function DashboardLayout({
>
<IconButton
className={cn(
'hidden md:block absolute left-[220px] top-4 p-2 z-2 rounded-full shadow-insetBasic bg-lightmodePureWhite hover:bg-lightmodeIndigoSolid3',
'hidden md:block absolute left-[220px] top-4 p-2 z-2 rounded-full shadow-insetBasic bg-basePureWhite hover:bg-baseIndigoSolid3',
styles.CollapseBtn,
isCollapsed && styles.Collapsed
)}
Expand All @@ -40,9 +40,9 @@ export function DashboardLayout({
items={dashboardConfig.sidebarNav}
/>

<div className="md:hidden basis-2 z-1">
{/* <div className="md:hidden basis-2 z-1">
<MobileDashboardNav items={dashboardConfig.sidebarNav} />
</div>
</div> */}
<main className={cn(styles.Main, `grow`)}>{children}</main>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function DashboardSidebar({ items, isCollapsed }: DashboardNavProps) {
return (
<aside
className={cn(
'pt-4 bg-backgroundDefault shadow-insetBasic',
'pt-4 bg-backgroundSolidDefault shadow-insetBasic',
'hidden z-1 basis-[240px] shrink-0 md:block overflow-hidden',
isCollapsed && 'basis-[24px]',
styles.Collapse
Expand All @@ -34,7 +34,7 @@ export function DashboardSidebar({ items, isCollapsed }: DashboardNavProps) {
<nav className={cn('flex flex-col gap-2 relative')}>
<Text
className={cn(
'py-2 px-4 z-max text-lightmodeGraySlateSolid11',
'py-2 px-4 z-max text-baseGraySlateSolid11',
isCollapsed && 'hidden'
)}
variant="headingSmSpaced"
Expand Down Expand Up @@ -85,10 +85,10 @@ const SidebarLink = ({
/>
<div
className={cn(
'flex items-center w-full mx-2 rounded-1 hover:bg-lightmodeIndigoAlpha3',
'flex items-center w-full mx-2 rounded-1 hover:bg-baseIndigoAlpha3',
styles.Item,
isActive(department, href, district) &&
'bg-lightmodeIndigoAlpha4 text-lightmodeVioletAlpha11 hover:bg-lightmodeIndigoAlpha4'
'bg-baseIndigoAlpha4 text-baseVioletAlpha11 hover:bg-baseIndigoAlpha4'
)}
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface IProps {
export function Content({ data }: { data: IProps }) {
const breadcrumbs = [
{
label: 'Assam',
label: <Icon source={Icons.home} />,
href: '/',
},
{
Expand All @@ -50,84 +50,85 @@ export function Content({ data }: { data: IProps }) {
return (
<>
<BreadCrumb backUrl="/" crumbs={breadcrumbs} />
<div className="container py-1 lg:py-2">
<Text variant="heading3xl" as="h1" color="subdued" className="mt-7">
{data.title} District
</Text>

<Text variant="heading3xl" as="h1" color="subdued" className="mt-7">
{data.title} District
</Text>
<div className="mt-6 bg-surfaceDefault rounded-05 shadow-elementCard">
<Collapsible defaultOpen>
<CollapsibleTrigger className={styles.CollapseTrigger}>
<Text variant="headingMd" as="h2">
{data.collapsible.title}
</Text>
<Icon source={Icons.down} />
</CollapsibleTrigger>

<div className="mt-6 bg-surfaceDefault rounded-05 shadow-elementCard">
<Collapsible defaultOpen>
<CollapsibleTrigger className={styles.CollapseTrigger}>
<Text variant="headingMd" as="h2">
{data.collapsible.title}
</Text>
<Icon source={Icons.down} />
</CollapsibleTrigger>

<CollapsibleContent className="pb-4 px-6">
<Separator />
<div className="mt-4 grid lg:grid-cols-2 gap-7">
<div className="flex flex-col gap-4">
<Text variant="headingSm" as="h3" color="subdued">
Key Highlights
</Text>

<div className="grid gap-4 sm:grid-cols-2">
{data.collapsible.content.cards.map((card, index) => (
<ContentCard
key={card.label + index}
value={card.value}
label={card.label}
color={card.color}
/>
))}
</div>
</div>
<div className="flex flex-col gap-4">
<div className="flex items-center gap-2 justify-between">
<CollapsibleContent className="pb-4 px-6">
<Separator />
<div className="mt-4 grid lg:grid-cols-2 gap-7">
<div className="flex flex-col gap-4">
<Text variant="headingSm" as="h3" color="subdued">
About {data.title}
Key Highlights
</Text>
{data.link && (
<Text
variant="bodyMd"
className="underline text-textInteractive"
>
<Link href={data.link} target="_blank">
<span className="flex items-center gap-2">
Go to District Website
<Icon source={Icons.externalLink} />
</span>
</Link>
</Text>
)}

<div className="grid gap-4 sm:grid-cols-2">
{data.collapsible.content.cards.map((card, index) => (
<ContentCard
key={card.label + index}
value={card.value}
label={card.label}
color={card.color}
/>
))}
</div>
</div>
<div className="flex flex-col gap-3">
{data.collapsible.content.description.map((item) => (
<Text variant="bodyLg" as="p" key={item}>
{item}
<div className="flex flex-col gap-4">
<div className="flex items-center gap-2 justify-between">
<Text variant="headingSm" as="h3" color="subdued">
About {data.title}
</Text>
))}
{data.link && (
<Text
variant="bodyMd"
className="underline text-textInteractive"
>
<Link href={data.link} target="_blank">
<span className="flex items-center gap-2">
Go to District Website
<Icon source={Icons.externalLink} />
</span>
</Link>
</Text>
)}
</div>
<div className="flex flex-col gap-3">
{data.collapsible.content.description.map((item) => (
<Text variant="bodyLg" as="p" key={item}>
{item}
</Text>
))}
</div>
</div>
</div>
</div>
</CollapsibleContent>
</Collapsible>
</div>
</CollapsibleContent>
</Collapsible>
</div>

<div className="mt-12 flex flex-col gap-4">
<div className="flex gap-5 items-center justify-between flex-wrap">
<Text variant="headingLg" as="h2">
{data.listTitle}
</Text>
<Search />
<div className="mt-12 flex flex-col gap-4">
<div className="flex gap-5 items-center justify-between flex-wrap">
<Text variant="headingLg" as="h2">
{data.listTitle}
</Text>
<Search />
</div>
<Separator />
</div>
<div className="mt-6 grid gap-4 lg:grid-cols-2">
{data.list.map((item) => (
<DepartmentCard data={item} district={data.href} key={item.label} />
))}
</div>
<Separator />
</div>
<div className="mt-6 grid gap-4 lg:grid-cols-2">
{data.list.map((item) => (
<DepartmentCard data={item} district={data.href} key={item.label} />
))}
</div>
</>
);
Expand Down
Loading

1 comment on commit dca5665

@vercel
Copy link

@vercel vercel bot commented on dca5665 Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

opub-www – ./apps/www

opub-www.vercel.app
opub-www-git-main-civicdatalab.vercel.app
opub-www-civicdatalab.vercel.app

Please sign in to comment.