Skip to content
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

chore: created config file with appropriate demarcation #2

Merged
merged 5 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
24 changes: 0 additions & 24 deletions app/home/FAQ/data.ts

This file was deleted.

8 changes: 4 additions & 4 deletions app/home/FAQ/faq.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
AccordionTrigger,
} from '@/components/ui/accordion';

import data from './data';
import { homeData } from '@/config/home';

export default function FAQs() {
return (
Expand All @@ -18,16 +18,16 @@ export default function FAQs() {
<div className="text-4xl font-medium">Have a Question?</div>

<Accordion type="single" collapsible className="w-full px-c3 py-c1">
{data.map((item, index) => (
{homeData.FAQConfig.map((item, index) => (
<FAQ.Content key={index} value={`item-${index.toString()}`}>
<FAQ.Question>
<div className="text-left">
{index + 1}. {item.Question}
{index + 1}. {item.question}
</div>
</FAQ.Question>

<FAQ.Answer>
<div className="transition-color font-light">{item.Answer}</div>
<div className="transition-color font-light">{item.answer}</div>
</FAQ.Answer>
</FAQ.Content>
))}
Expand Down
4 changes: 2 additions & 2 deletions app/home/info/info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
CardTitle,
} from '@/components/ui/card';

import data from './data';
import cardsConfig from '@/config/cards';

export default function Info() {
return (
Expand All @@ -20,7 +20,7 @@ export default function Info() {
className="flex flex-col items-center justify-center gap-c3vh
lg:grid lg:grid-cols-2 lg:gap-c3vh"
>
{data.map((item, index) => (
{cardsConfig.map((item, index) => (
<Card
className="relative h-fit w-fit overflow-hidden rounded-lg
shadow-md md:w-fit"
Expand Down
8 changes: 4 additions & 4 deletions app/home/title.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { siteConfig } from '@/site.config';
import { homeData } from '@/config/home';

import Link from 'next/link';

export default function Title() {
return (
return (
<div className="mt-c25 flex h-c60 flex-col items-center justify-between overflow-x-hidden md:mt-c15 md:h-c30 lg:h-c30 xl:mt-c5 xl:h-c45">
<div className="px-3 text-center text-5xl font-bold duration-1000 animate-in fade-in-0 md:text-6xl xl:text-7xl">
{siteConfig.homePage.tagline}
{homeData.tagline}
</div>

<div className="px-c10 text-center sm:text-xs md:text-base lg:text-xl">
{siteConfig.description}
{homeData.description}
</div>

<div className="flex justify-between gap-c3 md:gap-c10">
Expand Down
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { siteConfig } from '@/site.config';
import { siteConfig } from '@/config/site';

import { Metadata, Viewport } from 'next';

Expand Down
2 changes: 1 addition & 1 deletion components/icon-list.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { siteConfig } from '@/site.config';
import { siteConfig } from '@/config/site';

import Link from 'next/link';

Expand Down
2 changes: 1 addition & 1 deletion components/main-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { siteConfig } from '@/site.config';
import { siteConfig } from '@/config/site';

import React from 'react';

Expand Down
2 changes: 1 addition & 1 deletion components/site-footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { siteConfig } from '@/site.config';
import { siteConfig } from '@/config/site';

import Link from 'next/link';

Expand Down
2 changes: 1 addition & 1 deletion components/site-sheet.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { siteConfig } from '@/site.config';
import { siteConfig } from '@/config/site';

import Link from 'next/link';

Expand Down
4 changes: 2 additions & 2 deletions app/home/info/data.tsx → config/cards.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Icons } from '@/components/icons';

const data = [
const cardsConfig = [
{
Title: 'Web Template',
Description:
Expand All @@ -27,4 +27,4 @@ const data = [
},
];

export default data;
export default cardsConfig;
27 changes: 27 additions & 0 deletions config/home.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export const homeData = {
Copy link
Member

Choose a reason for hiding this comment

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

if we're going to stick to siteConfig and cardsConfig then might as well have this as homeConfig.

Suggested change
export const homeData = {
export const homeConfig = {

tagline: 'One Ecosystem for all Clubs.',
description:
'Empower your MIT Bengaluru club experience with our centralized platform, seamlessly managing and collaborating on events, blogs, and administration.',
FAQConfig : [
Copy link
Member

Choose a reason for hiding this comment

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

we should also consider making a type for FAQConfig (maybe FAQItem) so that this array can satisfy FAQItem[].

{
question: 'What is mitblr.club?',
answer:
'mitblr.club serves as a centralized platform for MIT, Bengaluru clubs, streamlining event management, administrative functions, and fostering collaboration among clubs.',
},
{
question: 'Who maintains the mitblr.club ecosystem?',
answer:
'While mitblr.club is maintained by the CodeX club, it is open-source and clubs are encouraged to contribute to the project.',
},
{
question: 'Is mitblr.club free to use?',
answer:
'Yes, mitblr.club is compltely free to use, including obtaining a club specific subdomain and Outlook id',
},
{
question: 'Does mitblr.club have a mobile app?',
answer:
'Yes, mitblr.club has multiple apps designed for both Android and iOS. You can find the links to the apps on the home page.',
},
],
}
6 changes: 1 addition & 5 deletions site.config.ts → config/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ export type SiteConfig = typeof siteConfig;
export const siteConfig = {
name: 'Club Name',
institution: 'Manipal Institute of Technology Bengaluru (MIT)',
description:
'Empower your MIT Bengaluru club experience with our centralized platform, seamlessly managing and collaborating on events, blogs, and administration.',
description: "Site metdata description!",
eventsTableId: 'df0bbd9604a846468e6aaf7f41042c1c',
blogTableId: 'd8caac170c6243a18228b8467ec1f41e',
navLinks: [
Expand Down Expand Up @@ -34,7 +33,4 @@ export const siteConfig = {
number: '+91 1234567890',
email: 'abc.efg@gmail.com',
},
homePage: {
tagline: 'One Ecosystem for all Clubs.',
},
};
2 changes: 1 addition & 1 deletion lib/getBlogPosts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { siteConfig } from '@/site.config';
import { siteConfig } from '@/config/site';

export async function getBlogPosts() {
const res = await fetch(
Expand Down
2 changes: 1 addition & 1 deletion lib/getEventPosts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { siteConfig } from '@/site.config';
import { siteConfig } from '@/config/site';

export async function getEventPosts() {
const res = await fetch(
Expand Down