Skip to content

Commit

Permalink
refactor code structure
Browse files Browse the repository at this point in the history
  • Loading branch information
IgboPharaoh committed Sep 11, 2024
1 parent cb8c242 commit 43752b7
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 158 deletions.
54 changes: 0 additions & 54 deletions src/app/components/FooterComponent.tsx

This file was deleted.

49 changes: 0 additions & 49 deletions src/app/components/FooterTop.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions src/app/components/index.tsx

This file was deleted.

8 changes: 6 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import React from "react";
import { HeroSection, Header, FeaturedTranscripts, ExploreTranscripts, FooterTop, WhyTranscripts, FooterComponent } from "./components";
import Header from "@/components/layout/Header";
import HeroSection from "@/components/landing-page/HeroSection";
import FeaturedTranscripts from "@/components/landing-page/featured-transcripts/FeaturedTranscripts";
import WhyTranscripts from "@/components/landing-page/WhyTranscripts";
import ExploreTranscripts from "@/components/landing-page/explore-transcripts/ExploreTranscripts";
import FooterComponent from "@/components/layout/FooterComponent";

export default function Home() {
return (
Expand All @@ -10,7 +15,6 @@ export default function Home() {
<FeaturedTranscripts />
<WhyTranscripts />
<ExploreTranscripts />
<FooterTop />
<FooterComponent />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React from "react";
import Link from "next/link";
import Image from "next/image";

import { Wrapper } from ".";
import HeroImageDestop from "/public/images/hero-desktop-image.webp";
import { ArrowLinkUpRight } from "@bitcoin-dev-project/bdp-ui/icons";
import circleBackground from "/public/svgs/circle-background.svg";
import circleBackgroundMobile from "/public/svgs/circle-background-mobile.svg";
import mobileDesktopImage from "/public/svgs/mobile-desktop-image.svg";
import Wrapper from "../layout/Wrapper";

const HeroSection = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import Link from "next/link";
import Image from "next/image";
import { menuApps } from "@/utils/data";
import { LanguageSwitcher, ThemeSwitcher } from "./Header";
import { LanguageSwitcher, ThemeSwitcher } from "../layout/Header";
import { ArrowLinkUpRight } from "@bitcoin-dev-project/bdp-ui/icons";

const MobileMenu = () => {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import React from "react";
import Image from "next/image";
import Link from "next/link";
import { SuggestModal, Wrapper } from ".";
import userTranscribing from "/public/images/user-typing.webp";
import wordList from "/public/images/word-list.webp";
import bitcoinMap from "/public/images/bitcoin-map.png";
import Wrapper from "../layout/Wrapper";
import SuggestModal from "./SuggestionModal";

const WhyTranscripts = () => {
const [isOpen, setIsOpen] = React.useState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import React from "react";
import Link from "next/link";
import { ExploreTranscriptCard } from ".";
import { Carousel } from "@bitcoin-dev-project/bdp-ui";
import { ArrowLinkRight } from "@bitcoin-dev-project/bdp-ui/icons";
import { ExploreTranscriptCard } from "../TranscriptCard";

interface TagInfo {
title: string;
Expand Down Expand Up @@ -33,10 +33,7 @@ const ExploreTranscriptClient = ({ categories, types }: ExploreTranscriptClientP
<section className='flex flex-col gap-6 w-full'>
<section className='flex items-center gap-4 w-full'>
<h3 className='text-2xl font-semibold max-md:text-xl'>Categories</h3>
<Link
href='/tags'
className='w-fit px-5 py-[6px] rounded-full border border-black flex gap-1 items-center max-md:py-1 max-md:px-3'
>
<Link href='/tags' className='w-fit px-5 py-[6px] rounded-full border border-black flex gap-1 items-center max-md:py-1 max-md:px-3'>
<p className='leading-[19.2px] text-sm font-medium'>View All</p>
<ArrowLinkRight className='text-black w-6 max-md:w-5' />
</Link>
Expand All @@ -59,10 +56,7 @@ const ExploreTranscriptClient = ({ categories, types }: ExploreTranscriptClientP
<section className='flex flex-col gap-6 w-full'>
<section className='flex items-center gap-4 w-full'>
<h3 className='text-2xl font-semibold max-md:text-xl'>Types</h3>
<Link
href='/categories'
className='w-fit px-5 py-[6px] rounded-full border border-black flex gap-1 items-center max-md:py-1 max-md:px-3'
>
<Link href='/categories' className='w-fit px-5 py-[6px] rounded-full border border-black flex gap-1 items-center max-md:py-1 max-md:px-3'>
<p className='leading-[19.2px] text-sm font-medium'>View All</p>
<span>
<ArrowLinkRight className='text-black w-6 max-md:w-5' />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"use server";

import React from "react";
import path from "path";
import * as fs from "fs";
import { Wrapper, ExploreTranscriptClient } from ".";
import Wrapper from "@/components/layout/Wrapper";
import ExploreTranscriptClient from "./ExploreTranscriptClient";

function getTags() {
const filePath = path.join(process.cwd(), "public", "tag-data.json");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React, { useState } from "react";
import { Transcript } from "contentlayer/generated";
import { DiceIcon } from "@bitcoin-dev-project/bdp-ui/icons";
import { TranscriptCard } from ".";
import TranscriptCard from "../TranscriptCard";

const FeaturedTranscriptClient = ({
featuredTranscripts,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"use server";

import React from "react";
import { extractTranscripts } from "@/utils";
import { Wrapper, FeaturedTranscriptClient } from ".";
import { allTranscripts } from "contentlayer/generated";
import Wrapper from "@/components/layout/Wrapper";
import FeaturedTranscriptClient from "./FeaturedTranscriptClient";

const FeaturedTranscripts = () => {
const { latestTranscripts, featuredTranscripts } = extractTranscripts(allTranscripts);
Expand Down
98 changes: 98 additions & 0 deletions src/components/layout/FooterComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
"use client";

import React from "react";
import { Footer } from "@bitcoin-dev-project/bdp-ui";
import Link from "next/link";
import { menuApps } from "@/utils/data";
import Image from "next/image";
import Wrapper from "./Wrapper";
import Logo from "./Logo";

const FooterComponent = () => {
return (
<>
<Wrapper className='pt-16 pb-20 flex justify-between max-md:flex-col max-md:px-6 max-md:gap-8 max-md:pt-6 max-md:pb-8'>
<section className='flex justify-between w-[50%] gap-8 max-md:flex-col max-md:w-full'>
<section className='flex flex-col gap-6 max-w-[400px] max-md:gap-4 max-md:max-w-full max-md:w-full'>
<Logo iconStyles='w-14 max-xl:w-[45px]' textStyles='text-5xl text-black max-xl:text-[32px]' />
<p className='font-medium sm:text-sm md:text-base xl:text-lg text-gray-custom-800 max-xl:text-base max-md:text-sm'>
Community-maintained archive to unlocking knowledge from technical bitcoin transcripts
</p>
</section>
<section className='flex flex-col gap-12 text-black font-bold text-xl underline max-xl:text-base max-xl:gap-8 max-md:gap-4'>
<Link href='https://btctranscripts.com/' target='_blank'>
Transcripts
</Link>
<Link href='/About' className='hidden'>
About
</Link>
</section>
</section>

<section className='flex flex-col gap-6 max-md:gap-4'>
<h4 className='text-black text-xl max-md:text-base'>Explore all Products</h4>
<section className='flex max-w-[400px] gap-12 flex-wrap max-xl:gap-6 max-md:max-w-full max-lg:gap-4'>
{menuApps.slice(1).map(({ href, image, alt }) => (
<Link href={href} target='_blank' rel='noopener noreferrer' key={alt}>
<Image
className={`rounded-xl w-[54px] h-[54px] lg:w-16 lg:h-16 border border-gray-custom-200 ${
alt === "Bitcoin search" || alt === "Bitcoin TLDR" ? "border border-gray-custom-200" : ""
}`}
src={image}
alt={alt}
width={88}
height={88}
/>
</Link>
))}
</section>
</section>
</Wrapper>

<div>
<div className='border-b-[0.5px] border-b-gray-custom-400 max-md:mx-6'></div>
<Wrapper className='py-10 max-md:pt-8 max-md:pb-[67px] max-lg:px-2 w-full'>
<Footer>
<Footer.Socials
platforms={[
{
entity: "github",
entityLink: "https://github.com/bitcointranscripts/registry",
iconProps: {
className: "hover:text-orange-400",
},
},
{
entity: "discord",
entityLink: "https://discord.gg/EAy9XMufbY",
iconProps: {
className: "hover:text-orange-400",
},
},
{
entity: "twitter",
entityLink: "https://x.com/Bitcoin_Devs",
iconProps: {
className: "hover:text-orange-400",
},
},
{
entity: "nostr",
entityLink: "https://njump.me/npub10p33xu03t8q7d9nxtks63dq4gmt4v4d3ppd5lcdp4rg9hxsd0f8q7mn2l2",
iconProps: {
className: "hover:text-orange-400",
},
},
]}
/>
<Footer.Public dashboardLink='https://visits.bitcoindevs.xyz/share/7hL0ysupLrZQsKRw/btc-transcripts' />
<Footer.About entityLink='https://bitcoindevs.xyz' entityName='Bitcoin Dev Project' />
<Footer.Feedback feedbackLink='https://cryptpad.fr/form/#/2/form/view/3P2CsohsHOkcH7C+WdtX0-tvqjBHqXnAmz5D9yx0e04/' />
</Footer>
</Wrapper>
</div>
</>
);
};

export default FooterComponent;
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import React, { useState, useRef, useEffect } from "react";
import Link from "next/link";
import Image from "next/image";
import { Wrapper, Logo } from ".";
// import { Wrapper, Logo } from "../landing-page";
import MenuIcon from "/public/svgs/menu.svg";
import MobileMenu from "./MobileMenu";
import MobileMenu from "../landing-page/MobileMenu";
import { MenuApp, menuApps } from "@/utils/data";
import { AppsIcon, ArrowRight, CloseIconOutlined, DayIcon, NightIcon, SearchIcon } from "@bitcoin-dev-project/bdp-ui/icons";
import Wrapper from "./Wrapper";
import Logo from "./Logo";

export const LanguageSwitcher = () => {
const [isOpen, setOpen] = useState(false);
Expand Down Expand Up @@ -189,8 +191,8 @@ const Header = () => {
<section className='flex items-center gap-16 max-xl:gap-8 max-lg:gap-4'>
<Logo iconStyles='w-9 max-xl:w-[30px]' textStyles='text-black text-[24px] leading-[36.77px] max-lg:text-base' />
<nav className='md:hidden items-center gap-16 text-black max-xl:gap-4 max-lg:text-sm max-md:hidden'>
<Link href='https://btctranscripts.com/'>Transcripts</Link>
<Link href='/transcripts' className='hidden'>
<Link href='/transcripts'>Transcripts</Link>
<Link href='/about' className='hidden'>
About
</Link>
</nav>
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 43752b7

Please sign in to comment.