This repository has been archived by the owner on Nov 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: tailwind theme configuration & custom components (#21)
* chore: init tailwind theme * a * remove pnpm lockfile * add font to antd
- Loading branch information
Showing
35 changed files
with
961 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,5 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.eslintcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"tabWidth": 2, | ||
"endOfLine": "auto", | ||
"trailingComma": "none", | ||
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"] | ||
} | ||
|
||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"tabWidth": 2, | ||
"endOfLine": "auto", | ||
"trailingComma": "none", | ||
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export default { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
autoprefixer: {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const classRegular = | ||
'rounded-[5px] bg-transparent border border-[#FFF0BF] px-4 py-2 font-body font-normal text-primary_yellow-100 transition-colors duration-300 hover:text-[#FFF0BF]' | ||
const classDisabled = | ||
'cursor-not-allowed rounded-[5px] border border-[#BAB39D] px-4 py-2 font-body font-normal text-[#9D9477]' | ||
const ButtonOutlined: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>> = ({ | ||
...props | ||
}: React.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element => { | ||
return ( | ||
<button {...props} className={props.disabled ? classDisabled : classRegular}> | ||
{props.children} | ||
</button> | ||
) | ||
} | ||
|
||
export default ButtonOutlined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const classRegular = | ||
'rounded-[5px] bg-primary_yellow-100 px-4 py-2 font-body font-normal text-primary-200 transition-colors duration-300 hover:bg-primary_yellow-300 hover:text-primary-300' | ||
const classDisabled = 'cursor-not-allowed rounded-[5px] bg-[#FFF0BF] px-4 py-2 font-body font-normal text-[#A5A6A7]' | ||
const ButtonPrimary: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>> = ({ | ||
...props | ||
}: React.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element => { | ||
return ( | ||
<button {...props} className={props.disabled ? classDisabled : classRegular}> | ||
{props.children} | ||
</button> | ||
) | ||
} | ||
|
||
export default ButtonPrimary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const classRegular = | ||
'rounded-[5px] bg-[#8AD5F4] px-4 py-2 font-body font-normal text-primary-100 transition-colors duration-300 hover:bg-secondary_blue-100 hover:text-primary-300' | ||
const classDisabled = 'cursor-not-allowed rounded-[5px] bg-[#D1F2FF] px-4 py-2 font-body font-normal text-primary-400' | ||
const ButtonSecondary: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>> = ({ | ||
...props | ||
}: React.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element => { | ||
return ( | ||
<button {...props} className={props.disabled ? classDisabled : classRegular}> | ||
{props.children} | ||
</button> | ||
) | ||
} | ||
|
||
export default ButtonSecondary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Input as AntdInput, InputProps } from 'antd' | ||
|
||
const Input: React.FC<InputProps> = ({ ...props }: InputProps) => { | ||
return ( | ||
<div className="flex flex-col"> | ||
<label className="font-body text-text_color-100"> | ||
{props.title} {props.required && <span className="text-primary_yellow-100">*</span>} | ||
</label> | ||
<AntdInput | ||
{...props} | ||
className="rounded-[5px] bg-white px-3 py-2 text-primary_yellow-100 focus:text-primary-100 focus:shadow-[0_4px_6px_0px_rgba(138,213,244,0.25)] focus:outline-none focus:ring-2 focus:ring-[#8AD5F4]" | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default Input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Modal as AntModal } from 'antd' | ||
import React, { useState } from 'react' | ||
import ButtonPrimary from './Buttons/ButtonPrimary' | ||
|
||
const ModalTemplate: React.FC = (): JSX.Element => { | ||
const [isModalOpen, setIsModalOpen] = useState(false) | ||
|
||
return ( | ||
<> | ||
<ButtonPrimary onClick={() => setIsModalOpen(true)}>Open Modal</ButtonPrimary> | ||
<AntModal | ||
open={isModalOpen} | ||
className="size-[800px]" | ||
classNames={{ | ||
body: 'bg-transparent', | ||
header: 'bg-transparent', | ||
footer: 'bg-transparent text-center', | ||
content: 'bg-gradient-to-br from-[#132635] to-[#1E3B52] rounded-[25px]' | ||
}} | ||
closable={false} | ||
footer={[ | ||
<ButtonPrimary key="confirm" onClick={() => setIsModalOpen(false)}> | ||
ยืนยัน | ||
</ButtonPrimary> | ||
]} | ||
> | ||
<h1 className="mb-5 text-center font-heading text-2xl text-primary_yellow-100">หมวดอัลกอริทึม</h1> | ||
<p className="font-body text-lg font-normal text-text_color-100"> | ||
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eos dolores, veritatis qui error perspiciatis neque | ||
ratione vitae architecto nam, dolore eum repellendus laudantium, commodi fugiat. Doloribus voluptas unde eius | ||
iusto. <br /> | ||
ปิกอัพแพทยสภาราเมนจิตเภท คอนเทนเนอร์หมายปองแอร์เรซิ่น เทคเที่ยงคืนตรวจสอบไวอะกร้ารุสโซ ควีน | ||
หมั่นโถวเอ็กซ์เพรสบ๊อบแอปเปิล คูลเลอร์สติ๊กเกอร์บรรพชนอิมพีเรียล อะเวอร์แม็กกาซีน ซิตี้ตังค์เกมส์วิกดีมานด์ | ||
แฟกซ์รีโมตอพาร์ทเมนท์แฮนด์ ราชานุญาตคลาสสิกภควัมปติเบบี้ สะเด่าโค้กฟินิกซ์เป่ายิงฉุบ โบรกเกอร์เฝอ | ||
จังโก้พาวเวอร์บัส เจี๊ยวพุทธศตวรรษชัตเตอร์ซานตาคลอส เก๊ะ แชมปิยอง | ||
</p> | ||
<p className="font-body text-lg font-normal text-text_color-100"> | ||
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eos dolores, veritatis qui error perspiciatis neque | ||
ratione vitae architecto nam, dolore eum repellendus laudantium, commodi fugiat. Doloribus voluptas unde eius | ||
iusto. <br /> | ||
ปิกอัพแพทยสภาราเมนจิตเภท คอนเทนเนอร์หมายปองแอร์เรซิ่น เทคเที่ยงคืนตรวจสอบไวอะกร้ารุสโซ ควีน | ||
หมั่นโถวเอ็กซ์เพรสบ๊อบแอปเปิล คูลเลอร์สติ๊กเกอร์บรรพชนอิมพีเรียล อะเวอร์แม็กกาซีน ซิตี้ตังค์เกมส์วิกดีมานด์ | ||
แฟกซ์รีโมตอพาร์ทเมนท์แฮนด์ ราชานุญาตคลาสสิกภควัมปติเบบี้ สะเด่าโค้กฟินิกซ์เป่ายิงฉุบ โบรกเกอร์เฝอ | ||
จังโก้พาวเวอร์บัส เจี๊ยวพุทธศตวรรษชัตเตอร์ซานตาคลอส เก๊ะ แชมปิยอง | ||
</p> | ||
</AntModal> | ||
</> | ||
) | ||
} | ||
|
||
export default ModalTemplate |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { ConfigProvider, ThemeConfig, theme } from 'antd' | ||
|
||
const customTheme: ThemeConfig = { | ||
token: { | ||
colorPrimary: '#274464', | ||
colorBgBase: '#0e1823', | ||
colorError: '#f48a8a', | ||
colorInfo: '#63a4ff', | ||
fontSize: 16, | ||
fontFamily: 'Lora, IBM Plex Sans' | ||
}, | ||
algorithm: theme.darkAlgorithm | ||
} | ||
|
||
const ThemeProvider = ({ children }: { children: React.ReactNode }) => { | ||
return <ConfigProvider theme={customTheme}>{children}</ConfigProvider> | ||
} | ||
|
||
export default ThemeProvider |
Oops, something went wrong.