Skip to content

Commit

Permalink
feat(nfts): ui-lib integration into taikoon-ui (#17220)
Browse files Browse the repository at this point in the history
Co-authored-by: bearni95 <[email protected]>
Co-authored-by: d1onys1us <[email protected]>
  • Loading branch information
3 people authored May 22, 2024
1 parent a551de1 commit 849a3c4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 250 deletions.
5 changes: 3 additions & 2 deletions packages/taikoon-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"build": "cd ../ui-lib && pnpm build && cd - && vite build",
"preview": "vite preview",
"test": "npm run test:integration && npm run test:unit",
"svelte:check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
Expand Down Expand Up @@ -69,6 +69,7 @@
"minidenticons": "^4.2.1",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"viem": "^2.9.29"
"viem": "^2.9.29",
"@taiko/ui-lib": "workspace:*"
}
}
248 changes: 2 additions & 246 deletions packages/taikoon-ui/src/components/sections/Footer.section.svelte
Original file line number Diff line number Diff line change
@@ -1,261 +1,17 @@
<script lang="ts">
import { json, t } from 'svelte-i18n';
import { Footer } from '@taiko/ui-lib';
import Copyright from '$components/core/Copyright/Copyright.svelte';
import { Icons } from '$components/core/Icons';
import { ResponsiveController } from '$components/core/ResponsiveController';
import { classNames } from '$lib/util/classNames';
import { Section } from '$ui/Section';
import type { IconType } from '../../types';
let windowSize: 'sm' | 'md' | 'lg' = 'md';
type ISocialLink = 'youtube' | 'twitter' | 'discord' | 'mirror' | 'forum' | 'none';
$: socialLinks = $json('content.sections.footer.socials') as {
name: ISocialLink;
url: string;
icon: IconType;
}[];
$: textLinks = $json('content.sections.footer.nav') as {
title: string;
list: {
name: string;
url: string;
}[];
}[];
const sectionClasses = classNames('justify-end align-end', 'mb-5');
const sectionWrapperClasses = classNames(
'w-full',
'flex flex-col',
'items-center',
'justify-center',
'bg-background-elevated',
'mt-5',
'p-5',
'rounded-2xl',
'md:gap-5',
'gap-10',
);
const joinTaikoClasses = classNames(
'w-full',
'flex',
'flex-row',
'items-center',
'justify-center',
'gap-5',
'text-xs',
'font-bold',
'font-sans',
'text-content-primary',
);
const socialLinksWrapperClasses = classNames('w-full', 'flex', 'flex-row', 'items-center', 'justify-center', 'gap-5');
const socialLinkClasses = classNames(
'w-1/5',
'flex flex-row',
'items-center',
'justify-center',
'bg-background-neutral',
'lg:p-5',
'p-3',
'gap-3',
'rounded-xl',
'text-content-primary',
'font-medium',
'lg:text-2xl',
'md:text-base',
'font-clash-grotesk',
'border',
'transition-all',
'border-transparent',
'hover:border-primary',
);
const bottomRowClasses = classNames(
'w-full',
'flex',
'md:flex-row',
'flex-col-reverse',
'items-center',
'justify-center',
'gap-5',
);
const bottomLeftColClasses = classNames(
'md:w-1/5',
'h-full',
'flex flex-col',
'items-start',
'justify-center',
'gap-5',
'my-5',
'md:my-0',
'w-full',
);
const bottomTitleClasses = classNames(
'text-4xl',
'font-clash-grotesk',
'font-medium',
'text-content-primary',
'md:text-left',
'text-center',
'w-full',
);
const bottomContentClasses = classNames(
'text-content-secondary',
'font-sans',
'text-base',
'font-normal',
'md:text-left',
'w-full',
'text-center',
);
const copyrightSmClasses = classNames(
'w-full',
'flex flex-row',
'items-center',
'justify-center',
'gap-5',
'px-5',
'pt-6',
'font-sans',
'text-base',
'text-content-secondary',
'font-normal',
);
const textLinksWrapperClasses = classNames(
'w-full',
'flex flex-col',
'items-center',
'justify-center',
'bg-background-neutral',
'rounded-3xl',
'p-7',
);
const textLinksRowClasses = classNames(
'w-full',
'h-full',
'flex',
'md:flex-row',
'flex-col',
'items-start',
'justify-start',
'gap-7',
'px-5',
'py-3',
);
const textLinksUlClasses = classNames(
'w-1/5',
'flex flex-col',
'items-start',
'justify-start',
'md:gap-6',
'gap-4',
'text-base',
'w-full',
);
const textLinkTitleClasses = classNames('font-bold', 'text-content-primary', 'text-base', 'uppercase');
const textLinkContentClasses = classNames(
'hover:text-primary',
'text-content-secondary',
'text-base',
'cursor-pointer',
);
const copyrightMdClasses = classNames(
'w-full',
'flex flex-row',
'items-center',
'justify-end',
'gap-5',
'px-5',
'py-3',
'font-sans',
'text-base',
'text-content-secondary',
'font-normal',
);
$: hoveredIcon = 'none' as ISocialLink;
</script>

<Section height={windowSize === 'sm' ? 'fit' : 'min'} background="footer" class={sectionClasses} width="xl">
<div class={sectionWrapperClasses}>
<div class={joinTaikoClasses}>
{$t('content.sections.footer.joinTaiko')}
</div>
<div class={socialLinksWrapperClasses}>
{#each socialLinks as { name, icon, url }}
{@const Icon = Icons[icon]}
<a
href={url}
on:mouseenter={() => (hoveredIcon = name)}
on:mouseleave={() => (hoveredIcon = 'none')}
target="_blank"
class={socialLinkClasses}>
<Icon
size={windowSize === 'md' ? '16' : '24'}
class={classNames(
'transition-colors',
//'text-primary'
hoveredIcon === name && hoveredIcon === 'youtube' ? 'text-red-500' : 'text-content-tertiary',
hoveredIcon === name && hoveredIcon === 'forum' ? 'text-primary' : 'text-content-tertiary',
hoveredIcon === name && hoveredIcon === 'discord' ? 'text-[#7289da]' : 'text-content-tertiary',
hoveredIcon === name && hoveredIcon === 'twitter' ? 'text-icon-primary' : 'text-content-tertiary',
hoveredIcon === name && hoveredIcon === 'mirror' ? 'text-icon-primary' : 'text-content-tertiary',
)} />
{#if windowSize !== 'sm'}
{name}
{/if}
</a>
{/each}
</div>

<div class={bottomRowClasses}>
<div class={bottomLeftColClasses}>
<div class={bottomTitleClasses}>
{$t('content.sections.footer.content.title')}
</div>
<div class={bottomContentClasses}>
{$t('content.sections.footer.content.text')}
</div>

{#if windowSize === 'sm'}
<Copyright class={copyrightSmClasses} />{/if}
</div>

<div class={textLinksWrapperClasses}>
<div class={textLinksRowClasses}>
{#each textLinks as textLink}
<ul class={textLinksUlClasses}>
<li class={textLinkTitleClasses}>
{textLink.title}
</li>
{#each textLink.list as link}
<li class={textLinkContentClasses}>
<a href={link.url}>{link.name}</a>
</li>
{/each}
</ul>
{/each}
</div>
{#if windowSize !== 'sm'}
<Copyright class={copyrightMdClasses} />
{/if}
</div>
</div>
</div>
<Footer />
</Section>

<ResponsiveController bind:windowSize />
2 changes: 1 addition & 1 deletion packages/taikoon-ui/src/routes/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const bannedCountries: Record<string, string> = {
const bannedCountryCodes = Object.keys(bannedCountries);
export function load(event: any) {
const country = event.request.headers.get('x-vercel-ip-country') ?? false;
const isDev = false; // event.url.hostname === 'localhost';
const isDev = event.url.hostname === 'localhost';
if (!isDev && (!country || bannedCountryCodes.includes(country))) {
return error(400, {
message: `The site is not available on the following countries: ${Object.values(bannedCountries).join(', ')}`,
Expand Down
9 changes: 8 additions & 1 deletion packages/taikoon-ui/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import UiLibConfig from '@taiko/ui-lib/tailwind'
import daisyuiPlugin from 'daisyui'

/** @type {import('tailwindcss').Config} */
export default {
...UiLibConfig,
darkMode: ['class', '[data-theme="dark"]'],
content: ['./src/**/*.{html,js,svelte,ts}'],
content: ['./src/**/*.{html,js,svelte,ts}', './node_modules/@taiko/ui-lib/src/**/*.{html,js,svelte,ts}'],
theme: {
extend: {
fontFamily: {
Expand Down Expand Up @@ -48,6 +50,8 @@ export default {
'arrows-x-3-reset': 'arrows-x-animation 300ms linear reverse',
},
colors: {
...UiLibConfig.theme.extend.colors,
'discord-purple': '#5765f1',
/***************
* Base colors *
***************/
Expand Down Expand Up @@ -285,6 +289,8 @@ export default {
themes: [
{
dark: {
...UiLibConfig.daisyui.themes[0].dark,

'color-scheme': 'dark',
'--btn-text-case': 'capitalize',
// '--rounded-box': '0.625rem', // 10px
Expand Down Expand Up @@ -398,6 +404,7 @@ export default {
},

light: {
...UiLibConfig.daisyui.themes[0].light,
'color-scheme': 'light',
'--btn-text-case': 'capitalize',

Expand Down
3 changes: 3 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 849a3c4

Please sign in to comment.