Skip to content

Commit

Permalink
fix: more style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdavis committed Jul 11, 2024
1 parent 5018220 commit a577bd4
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 10 deletions.
4 changes: 2 additions & 2 deletions apps/registry/app/[username]/jobs/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useRouter } from 'next/navigation';
import { useEffect, useState } from 'react';
import Hero from '../../../src/ui/Hero';
import JobList from './JobList';
import Loading from '../../components/Loading';

export default function Jobs({ params }) {
const username = params.username;
Expand Down Expand Up @@ -47,7 +48,6 @@ export default function Jobs({ params }) {
);
router.push(`/${username}/letter?job=${job.id}`);
};

return (
<div className="p-6">
<Hero
Expand All @@ -58,7 +58,7 @@ export default function Jobs({ params }) {
search."
/>

{!jobs && <div>Loading...</div>}
{!jobs && <Loading />}
<JobList jobs={jobs} makeCoverletter={makeCoverletter} />
</div>
);
Expand Down
11 changes: 7 additions & 4 deletions apps/registry/app/[username]/letter/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useEffect, useState } from 'react';
import { useSearchParams } from 'next/navigation';
import ReactMarkdown from 'react-markdown';
import Hero from '../../../src/ui/Hero';
import Loading from '../../components/Loading';

export default function Letter({ params }) {
const searchParams = useSearchParams();
Expand Down Expand Up @@ -53,7 +54,6 @@ export default function Letter({ params }) {
const handleGenerate = () => {
setSubmitting(true);
};

return (
<div className="p-6 bg-gray-50 min-h-screen">
<Hero
Expand Down Expand Up @@ -89,9 +89,12 @@ export default function Letter({ params }) {
{submitting ? 'GENERATING' : 'GENERATE'}
</button>
</div>
{letter && (
<div className="border border-gray-300 rounded-md p-6 bg-white shadow-md">
<ReactMarkdown>{letter}</ReactMarkdown>
{submitting && <Loading />}
{!submitting && letter && (
<div className="min-w-full border border-gray-300 rounded-md p-6 bg-white shadow-md">
<ReactMarkdown className="m-auto prose lg:prose-xl">
{letter}
</ReactMarkdown>
</div>
)}
</div>
Expand Down
8 changes: 6 additions & 2 deletions apps/registry/app/[username]/suggestions/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import axios from 'axios';
import { useEffect, useState } from 'react';
import Hero from '../../../src/ui/Hero';
import ReactMarkdown from 'react-markdown';
import Loading from '../../components/Loading';

export default function Suggestions({ params }) {
const { username } = params;
Expand Down Expand Up @@ -62,9 +63,12 @@ export default function Suggestions({ params }) {
</button>
</div>
<br />
{submitting && <Loading />}
{!submitting && suggestions && (
<div className="border border-gray-300 rounded-md p-6 bg-white shadow-md">
<ReactMarkdown>{suggestions}</ReactMarkdown>
<div className="min-w-full border border-gray-300 rounded-md p-6 bg-white shadow-md prose lg:prose-xl">
<ReactMarkdown className="m-auto prose lg:prose-xl">
{suggestions}
</ReactMarkdown>
</div>
)}
</div>
Expand Down
33 changes: 33 additions & 0 deletions apps/registry/app/components/Loading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';

const Loading = () => {
return (
<div className="flex justify-center items-center m-8">
<div className="flex flex-col items-center p-8 bg-white rounded-lg shadow-lg">
<svg
className="animate-spin h-10 w-10 text-secondary-500 mb-4"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
>
<circle
className="opacity-25"
cx="12"
cy="12"
r="10"
stroke="currentColor"
strokeWidth="4"
></circle>
<path
className="opacity-75"
fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291l2.414 2.415A8.001 8.001 0 014 12H0c0 2.489.92 4.778 2.414 6.585l1.586-1.294z"
></path>
</svg>
<div className="text-secondary-700 text-lg font-medium">Loading...</div>
</div>
</div>
);
};

export default Loading;
3 changes: 2 additions & 1 deletion apps/registry/app/explore/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import axios from 'axios';
import React, { useEffect, useState } from 'react';
import Link from 'next/link';
import Loading from '../components/Loading';

const formatLocation = (location) => {
if (!location) return 'Location not provided';
Expand Down Expand Up @@ -53,7 +54,7 @@ const Resumes = () => {
return (
<div className="max-w-4xl mx-auto p-6">
{!data.length ? (
<div className="text-center">Loading...</div>
<Loading />
) : (
<>
<input
Expand Down
1 change: 1 addition & 0 deletions apps/registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@pinecone-database/pinecone": "^0.1.6",
"@prisma/client": "^4.15.0",
"@supabase/supabase-js": "^2.39.6",
"@tailwindcss/typography": "^0.5.13",
"@vercel/analytics": "^1.3.1",
"ai": "^3.1.14",
"async": "^3.2.4",
Expand Down
3 changes: 2 additions & 1 deletion apps/registry/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ module.exports = {
},
},
},
plugins: [],

plugins: [require('@tailwindcss/typography')],
};

// my tailwind semantic colors are called accent, secondary, success, and danger. they have values 50,100,200,300,400,500,600,700,800,900,950.
27 changes: 27 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a577bd4

Please sign in to comment.