Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dheerajjha451 committed Jul 1, 2024
1 parent cc607f9 commit 0a68562
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 54 deletions.
5 changes: 5 additions & 0 deletions components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ const Footer = () => {
>
Feedback
</p>
<div className="space-x-2">
<Link href="https://www.producthunt.com/posts/design2code?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-design2code" target="_blank">
<img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=462353&theme=light" alt="Design2Code - Your&#0032;Hub&#0032;for&#0032;free&#0032;Project&#0032;Templates | Product Hunt" style={{ width: '250px', height: '54px' }} width="250" height="54" />
</Link>
</div>
</div>
</div>
</footer>
Expand Down
19 changes: 8 additions & 11 deletions components/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from 'next/link'
import React, { useState, useEffect } from 'react'
import { Code, SquareDashedBottomCode, Sun, Moon, Menu, X } from 'lucide-react'
import { SquareDashedBottomCode, Sun, Moon, Menu, X } from 'lucide-react'
import { Button } from './ui/button'
import { useSession } from 'next-auth/react'
import { Avatar, AvatarImage } from './ui/avatar'
Expand All @@ -17,9 +17,8 @@ const Header = () => {
setIsDarkMode(savedTheme === 'dark')
document.documentElement.classList.toggle('dark', savedTheme === 'dark')
} else {
const prefersDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
setIsDarkMode(prefersDarkMode)
document.documentElement.classList.toggle('dark', prefersDarkMode)
setIsDarkMode(false)
document.documentElement.classList.remove('dark')
}
}
}, [])
Expand All @@ -44,7 +43,6 @@ const Header = () => {
Design2Code
</span>
</Link>


<div className="flex items-center md:hidden">
<button onClick={handleToggle} className="text-primary">
Expand All @@ -57,14 +55,13 @@ const Header = () => {
{isDarkMode ? <Sun size={24} /> : <Moon size={24} />}
</button>
<Link href={'/projects'} className='flex items-center text-primary font-bold space-x-2'>
<SquareDashedBottomCode width={20} height={20} />
<span className="text-xl font-semibold whitespace-nowrap">
Projects
</span>
</Link>
<SquareDashedBottomCode width={20} height={20} />
<span className="text-xl font-semibold whitespace-nowrap">
Projects
</span>
</Link>
{session ? (
<>

<Avatar onClick={() => { window.location.href = '/dashboard' }} className="cursor-pointer">
<AvatarImage src={session.user.image} />
</Avatar>
Expand Down
4 changes: 2 additions & 2 deletions components/Spinner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const Spinner = () => {
return <>

<div role="status">
<svg aria-hidden="true" class="w-12 h-12 text-gray-200 animate-spin dark:text-gray-600 fill-pink-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg aria-hidden="true" className="w-12 h-12 text-gray-200 animate-spin dark:text-gray-600 fill-pink-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor" />
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill" />
</svg>
<span class="sr-only">Loading...</span>
<span className="sr-only">Loading...</span>
</div>

</>
Expand Down
1 change: 0 additions & 1 deletion components/dashboard/DashboardContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Button } from '../ui/button';

import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
Expand Down
6 changes: 3 additions & 3 deletions components/dashboard/TemplateForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Label } from '../ui/label';
import dynamic from 'next/dynamic';
import 'react-quill/dist/quill.snow.css';
import { Button } from '../ui/button';
import { FolderPlus, Trash } from 'lucide-react';
import { Trash } from 'lucide-react';
import axios from 'axios';
import { useSession } from 'next-auth/react';
import { useRouter } from 'next/router';
Expand Down Expand Up @@ -92,7 +92,7 @@ const TemplateForm = ({

async function uploadImages(ev) {
const files = ev.target?.files;
if (files.length > 0) {
if (files && files.length > 0) {
setIsUploading(true);

const resizedFiles = await Promise.all([...files].map(resizeImage));
Expand Down Expand Up @@ -183,7 +183,7 @@ const TemplateForm = ({
</div>

<div className="grid grid-cols-2 gap-4">
<Input type='url' placeholder='Deployed Link' value={deployedLink} onChange={(e) => setDeployedLink(e.target.value)} required />
<Input type='url' placeholder='Deployed Link' value={deployedLink} onChange={(e) => setDeployedLink(e.target.value)} />
<Input type='url' placeholder='Repository Link' value={repositoryLink} onChange={(e) => setRepositoryLink(e.target.value)} required />
</div>

Expand Down
17 changes: 10 additions & 7 deletions pages/api/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ export default async function handle(req, res) {

const form = new multiparty.Form();

const { fields, files } = await new Promise((resolve, reject) => {
const { files } = await new Promise((resolve, reject) => {
form.parse(req, (err, fields, files) => {
if (err) reject(err);
if (err) {
reject(err);
return;
}
resolve({ fields, files });
});
});
Expand All @@ -26,9 +29,9 @@ export default async function handle(req, res) {
public_id: `file_${Date.now()}`,
resource_type: "auto",
transformation: [
{ width: 800, height: 600, crop: "limit" },
{ quality: "auto:good" },
{ fetch_format: "auto" },
{ width: 800, height: 600, crop: "limit" },
{ quality: "auto:good" },
{ fetch_format: "auto" },
]
});
});
Expand All @@ -44,6 +47,6 @@ export default async function handle(req, res) {

export const config = {
api: {
bodyParser: false
}
bodyParser: false,
},
};
1 change: 0 additions & 1 deletion pages/dashboard/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import DashboardContent from '@/components/dashboard/DashboardContent'
import DashboardHeader from '@/components/dashboard/DashboardHeader'
import DashboardLayout from '@/components/dashboard/DashboardLayout'
import React from 'react'

Expand Down
50 changes: 22 additions & 28 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Icons } from '@/components/Icons'
import MaxWidthWrapper from '@/components/MaxWidthWrapper'
import { Button, buttonVariants } from '@/components/ui/button'
import { ArrowRight, Check, Star } from 'lucide-react'
import { Button} from '@/components/ui/button'
import { ArrowRight, Check} from 'lucide-react'
import Link from 'next/link'
import { useSession } from 'next-auth/react'
// import Image from 'next/image'

export default function Home() {
const { data: session } = useSession()

return (
<div className=''>
<section className="relative pb-24 pt-10 sm:pb-32 xl:pb-52 xl:pt-32 lg:pt-24">
Expand All @@ -23,7 +22,24 @@ export default function Home() {
Share your innovative designs and projects with the world.{' '}
<span className="font-semibold">Showcase</span> your talent with us.
</p>

<div className="md:flex items-center space-x-8 mt-12">
{session ? (
<Link href={'/projects'} className='flex items-center text-primary '>
<Button variant='default' className="text-xl font-semibold whitespace-nowrap ">
Start now
</Button>
</Link>
) : (
<Button variant='default' onClick={() => { window.location.href = '/login' }}>
Start now
</Button>
)}
</div>

<img src="/Lightui.png" alt="UI image" className="mt-12 shadow-2xl" />


<ul className="mt-8 space-y-2 text-left font-medium flex flex-col items-center sm:items-center">
<div className="space-y-2">
<li className="flex gap-1.5 items-center text-left">
Expand All @@ -40,33 +56,11 @@ export default function Home() {
</li>
</div>
</ul>


<div className="md:flex items-center space-x-8 mt-12">
{session ? (
<>
<Link href={'/projects'} className='flex items-center text-primary '>
<Button variant='default' className="text-xl font-semibold whitespace-nowrap ">
Start now
</Button>
</Link>
</>
) : (
<Button variant='default' onClick={() => { window.location.href = '/login' }}>
Start now
</Button>
)}
</div>
<div className="mt-12">
<Link href="https://www.producthunt.com/posts/design2code?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-design2code" target="_blank">
<img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=462353&theme=light" alt="Design2Code - Your&#0032;Hub&#0032;for&#0032;free&#0032;Project&#0032;Templates | Product Hunt" style={{ width: '250px', height: '54px' }} width="250" height="54" />
</Link>
</div>


</div>
</MaxWidthWrapper>
</section>

</div>
)
}

1 change: 0 additions & 1 deletion pages/projects/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Hero from "@/components/Hero";
import Templates from "@/components/Templates";
import Image from "next/image";

export default function Projects() {
return <>
Expand Down
Binary file added public/Lightui.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 public/UI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0a68562

Please sign in to comment.