Skip to content

Commit

Permalink
Merge pull request #10 from shaniit-org/dev
Browse files Browse the repository at this point in the history
update on homepage images:
  • Loading branch information
Riley1101 authored Nov 24, 2023
2 parents 46a1b63 + c3580b1 commit 49ab436
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 99 deletions.
4 changes: 2 additions & 2 deletions src/lib/components/common/Footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
<p class="text-white text-xl mb-6">Contact Us</p>
<p class="text-white mb-2">Email</p>
<TextInput
placeholder="Enter your name..."
placeholder="Enter your name"
class="mb-4 bg-[#262626] text-white"
type="email"
required
name="email"
/>
<p class="text-white mb-2">Message</p>
<TextArea
placeholder="Enter message..."
placeholder="Enter message"
class="mb-4 bg-[#262626] text-white"
name="message"
required
Expand Down
12 changes: 10 additions & 2 deletions src/lib/components/common/HomeEventCard.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<script>
import moment from 'moment';
import SanityImage from '$lib/sanity/image/SanityImage.svelte';
/**
* @type {import('../../types').News}
*/
export let data;
console.log(data);
</script>

<a href={`/events/${data.slug}`} class="cursor-pointer hover:bg-theme-muted bg-white flex flex-col">
<div class="flex flex-col justify-between p-4 flex gap-6">
<h3 class="text-lg text-theme-dark">
<SanityImage
maxWidth={450}
image={data.coverImage}
alt={data.title}
className=" aspect-video w-full object-cover"
/>
<div class="flex-col justify-between p-4 flex gap-6">
<h3 class="text-xl">
{data.title}
</h3>
<div class="flex flex-col">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/page/about/Team.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
className="aspect-video object-cover w-full h-full group-hover:scale-105 transition-all duration-500 cursor-pointer"
/>
</div>
<h3 class="text-xl mt-4 text-center">{dat.role}</h3>
<h3 class="text-xl mt-2 text-center">{dat.role}</h3>
</div>
{/each}
</div>
Expand Down
32 changes: 16 additions & 16 deletions src/lib/studio/schema/common/donator.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { FaPeopleCarry } from 'react-icons/fa';
export default {
icon: FaPeopleCarry,
title: 'Donor',
name: 'donator',
type: 'document',
fields: [
{
title: 'Name',
name: 'name',
type: 'string'
},
{
title: 'Units',
name: 'amount',
type: 'number'
}
]
icon: FaPeopleCarry,
title: 'Donor',
name: 'donator',
type: 'document',
fields: [
{
title: 'Name',
name: 'name',
type: 'string'
},
{
title: 'Units',
name: 'amount',
type: 'number'
}
]
};
46 changes: 23 additions & 23 deletions src/lib/studio/schema/pages/donate/document.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { FaDollarSign } from 'react-icons/fa';
export default {
icon: FaDollarSign,
id: 'donatePage',
title: 'Donate Page',
name: 'donatePage',
type: 'document',
fields: [
{ title: 'SEO', name: 'seo', type: 'seo' },
{ title: 'Title', name: 'title', type: 'string' },
{ title: 'CoverImage', name: 'coverImage', type: 'image' },
{ title: 'Content', name: 'content', type: 'blockContent' },
{
title: 'Payment Methods',
name: 'payment_methods',
type: 'array',
of: [{ type: 'payment_method' }]
},
{
title: 'Goal',
type: 'number',
name: 'goal'
}
],
preview: { select: { title: 'seo.title', media: 'seo.ogImage' } }
icon: FaDollarSign,
id: 'donatePage',
title: 'Donate Page',
name: 'donatePage',
type: 'document',
fields: [
{ title: 'SEO', name: 'seo', type: 'seo' },
{ title: 'Title', name: 'title', type: 'string' },
{ title: 'CoverImage', name: 'coverImage', type: 'image' },
{ title: 'Content', name: 'content', type: 'blockContent' },
{
title: 'Payment Methods',
name: 'payment_methods',
type: 'array',
of: [{ type: 'payment_method' }]
},
{
title: 'Goal',
type: 'number',
name: 'goal'
}
],
preview: { select: { title: 'seo.title', media: 'seo.ogImage' } }
};
36 changes: 18 additions & 18 deletions src/lib/types/donatePage.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
export interface DonatePageData {
seo: BaseMetaData;
title: string;
description: string;
content: PortableText;
payment_methods: PaymentMethod[];
payment_methods_description: string;
coverImage: SanityImage;
donors: Donator[];
goal: number;
seo: BaseMetaData;
title: string;
description: string;
content: PortableText;
payment_methods: PaymentMethod[];
payment_methods_description: string;
coverImage: SanityImage;
donors: Donator[];
goal: number;
}
export interface Donator {
_id: string;
group: string;
amount: number;
_id: string;
group: string;
amount: number;
}

export interface PaymentMethod {
name: string;
number: string;
Image: SanityImage;
name: string;
number: string;
Image: SanityImage;
}
export interface DonateRoadmap {
title: string;
description: PortableText;
target: number;
title: string;
description: PortableText;
target: number;
}
19 changes: 10 additions & 9 deletions src/routes/+page.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const query = `{
"slug":slug.current,
title,
description,
publishedAt
publishedAt,
coverImage ,
},
"news":*[_type =="news"] | order(publishedAt desc)[0...6] {
"slug":slug.current,
Expand All @@ -40,12 +41,12 @@ const query = `{
* @type {import('@sveltejs/kit').Load}
*/
export const load = async () => {
/**
* @type {import('$lib/types/homePage').HomePageData}
*/
const data = await getPageData(query);
if (!data.homePage) throw error(404, 'Not Found');
return {
data
};
/**
* @type {import('$lib/types/homePage').HomePageData}
*/
const data = await getPageData(query);
if (!data.homePage) throw error(404, 'Not Found');
return {
data
};
};
16 changes: 8 additions & 8 deletions src/routes/donate/+page.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ const query = `
* @type {import('@sveltejs/kit').Load}
*/
export const load = async () => {
/**
* @type {import('$lib/types/donatePage').DonatePageData}
*/
const data = await getPageData(query);
if (!data) throw error(404, 'Not Found');
return {
data
};
/**
* @type {import('$lib/types/donatePage').DonatePageData}
*/
const data = await getPageData(query);
if (!data) throw error(404, 'Not Found');
return {
data
};
};
2 changes: 1 addition & 1 deletion src/routes/donate/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
required
name="units"
/>
<TextArea labelText="Message" placeholder="Enter message..." name="message" required />
<TextArea labelText="Message" placeholder="Enter message" name="message" required />
<Button type="submit" class=" mt-4 bg-[#0F62FE]" kind="primary">Send</Button>
</form>
</div>
Expand Down
38 changes: 19 additions & 19 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./src/**/**/*.{html,js,svelte,ts}'],
theme: {
fontFamily: {
san: ['GreatHorKham Yangon', 'sans-serif']
},
extend: {
colors: {
'theme-primary': '#D0E2FF',
'theme-dark': '#161616',
'theme-muted': '#e8e8e8',
'theme-secondary': '#E8DAFF'
},
gridTemplateColumns: {
'auto-fill-100': 'repeat(auto-fill, minmax(100px, 1fr))',
'auto-fit-100': 'repeat(auto-fit, minmax(100px, 1fr))'
}
}
},
plugins: [require('@tailwindcss/typography')]
content: ['./src/**/**/*.{html,js,svelte,ts}'],
theme: {
fontFamily: {
san: ['GreatHorKham Yangon', 'sans-serif']
},
extend: {
colors: {
'theme-primary': '#D0E2FF',
'theme-dark': '#161616',
'theme-muted': '#e8e8e8',
'theme-secondary': '#E8DAFF'
},
gridTemplateColumns: {
'auto-fill-100': 'repeat(auto-fill, minmax(100px, 1fr))',
'auto-fit-100': 'repeat(auto-fit, minmax(100px, 1fr))'
}
}
},
plugins: [require('@tailwindcss/typography')]
};

0 comments on commit 49ab436

Please sign in to comment.