From a0ee6c8faeedf2d0913b3f862141984c9937c6dd Mon Sep 17 00:00:00 2001 From: boomchanotai Date: Thu, 3 Oct 2024 21:17:20 +0700 Subject: [PATCH] fix: lint --- .eslintrc.json | 8 +- src/app/activity/page.tsx | 132 +++++++------ src/app/gallery/page.tsx | 172 ++++++++--------- src/components/Banner.tsx | 109 ----------- src/components/Community/Benefits.tsx | 178 +++++++++--------- src/components/Community/ReviewFromUs.tsx | 51 ++--- .../Home/Background/MainBackground.tsx | 103 ---------- src/components/Home/Blockathon.tsx | 16 +- src/components/User/UserInfo.tsx | 130 ------------- 9 files changed, 278 insertions(+), 621 deletions(-) delete mode 100644 src/components/Banner.tsx delete mode 100644 src/components/Home/Background/MainBackground.tsx delete mode 100644 src/components/User/UserInfo.tsx diff --git a/.eslintrc.json b/.eslintrc.json index 6b10a5b..1a1ad7a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,6 +1,6 @@ { - "extends": [ - "next/core-web-vitals", - "next/typescript" - ] + "extends": ["next/core-web-vitals", "next/typescript"], + "rules": { + "@next/next/no-img-element": "off" + } } diff --git a/src/app/activity/page.tsx b/src/app/activity/page.tsx index 8a0b21a..0e5760b 100644 --- a/src/app/activity/page.tsx +++ b/src/app/activity/page.tsx @@ -1,83 +1,81 @@ -import { Swiper, SwiperSlide } from "swiper/react"; -import Link from 'next/link'; +import Link from "next/link"; import "swiper/css"; import "swiper/css/pagination"; import "swiper/css/free-mode"; -import { FreeMode, Pagination } from "swiper/modules"; - -import { RxArrowTopRight } from "react-icons/rx"; import FlareComponent from "@/components/Home/FlareComponent"; export default function Gallery() { - return ( -
-
-
-

- ACTIVITY -

- -

- What we have accomplished -

- -

- These pictures are like treasure boxes that store our memories. When we look at these images, we travel back to the moments that have passed. The various activities we have shared together are captured in there photos. -

- - - - - -
-
-

- Within Our Club!

-

- Discover a world of fascinating activities and thrilling experiences at our club. Whether you are looking to learn something new, meet amazing people, or simply have fun, we have something for everyone. Come and be part of our dynamic community! -

-
+ return ( +
+
+
+

+ ACTIVITY +

- - - +

+ What we have accomplished +

-
-

- Feedback From Our Collaborators

- -
- -
-
- - - - +

+ These pictures are like treasure boxes that store our memories. When + we look at these images, we travel back to the moments that have + passed. The various activities we have shared together are captured + in there photos. +

+ + + +
+
+

+ Within Our Club! +

+

+ Discover a world of fascinating activities and thrilling + experiences at our club. Whether you are looking to learn + something new, meet amazing people, or simply have fun, we have + something for everyone. Come and be part of our dynamic + community! +

- + + + +
- +

+ Feedback From Our Collaborators +

+
-
- - +
+ +
- ) -} \ No newline at end of file +
+ + ); +} diff --git a/src/app/gallery/page.tsx b/src/app/gallery/page.tsx index ebae476..e01cb59 100644 --- a/src/app/gallery/page.tsx +++ b/src/app/gallery/page.tsx @@ -1,103 +1,89 @@ -import { Swiper, SwiperSlide } from "swiper/react"; -import Link from 'next/link'; +import Link from "next/link"; import "swiper/css"; import "swiper/css/pagination"; import "swiper/css/free-mode"; -import { FreeMode, Pagination } from "swiper/modules"; - -import { RxArrowTopRight } from "react-icons/rx"; - - - export default function Gallery() { - return ( -
-
-
-

- Photo Gallery -

- -

- These pictures are like treasure boxes that store our memories. When we look at these images, we travel back to the moments that have passed. The various activities we have shared together are captured in there photos. -

- - -
-
-

- SCB x CUBS

-

- May 20, 2024 -

-
- - - - - - -
-

- Stockerday x CUBS

-

- May 20, 2024 -

-
- - - - - -
-

- KTB x CUBS

-

- May 20, 2024 -

-
- - - - - - - - -
-
- - - - - - + return ( +
+
+
+

+ Photo Gallery +

+ +

+ These pictures are like treasure boxes that store our memories. When + we look at these images, we travel back to the moments that have + passed. The various activities we have shared together are captured + in there photos. +

+ +
+
+

+ SCB x CUBS +

+

+ May 20, 2024 +

- -
- + + + + +
+

+ Stockerday x CUBS +

+

+ May 20, 2024 +

-
- + + + + +
+

+ KTB x CUBS +

+

+ May 20, 2024 +

+
- ) -} \ No newline at end of file + + + +
+
+
+ +
+
+ ); +} diff --git a/src/components/Banner.tsx b/src/components/Banner.tsx deleted file mode 100644 index 92f0f14..0000000 --- a/src/components/Banner.tsx +++ /dev/null @@ -1,109 +0,0 @@ -"use client"; - -import Image from "next/image"; - -import SCBX from "@/assets/partners/scb-x.png"; -import BitkubExchange from "@/assets/partners/bitkub-exchange.png"; -import ETHPadThai from "@/assets/partners/ethpadthai.png"; -import CryptoMind from "@/assets/partners/cryptomind.png"; -import IC from "@/assets/partners/ic.png"; -import Velo from "@/assets/partners/velo.png"; -import BinanceTH from "@/assets/partners/binance-th.png"; - -export default function Banner() { - const partners = [ - { - name: "SCBx", - image: SCBX, - }, - { - name: "Bitkub Exchange", - image: BitkubExchange, - }, - { - name: "ETHPadThai", - image: ETHPadThai, - }, - { - name: "CryptoMind", - image: CryptoMind, - }, - { - name: "IC", - image: IC, - }, - { - name: "Velo", - image: Velo, - }, - { - name: "Binance TH", - image: BinanceTH, - }, - ]; - - return ( -
-
-

- CU Blockchain Society -

- -

- We act as a central point connecting all parties interested in - blockchain technology, from enterprise users to general public. Our - goal is to fully optimize the value of the blockchain sector. -

- -
-
-

Our Mission

-

- Making Blockchain simple
- and easy to accessed by all
- genders and all ages. -

-
- -
-

Core Value

-

- Learn, Develop, Communicate and Take action. -

-
-
- -
-
-

- Trusted by 100+ Companies across the globe!{" "} -

-
-
- {partners.map((partner) => ( -
- {partner.name} -
- ))} -
-
-
- -
- ); -} diff --git a/src/components/Community/Benefits.tsx b/src/components/Community/Benefits.tsx index 1851e28..fc6b571 100644 --- a/src/components/Community/Benefits.tsx +++ b/src/components/Community/Benefits.tsx @@ -1,96 +1,102 @@ -"use client" +"use client"; -import React from 'react'; -import FlareComponent from '../Home/FlareComponent'; -import Connection from './Logo/Connection'; -import Coupon from './Logo/Coupon'; -import Internship from './Logo/Internship'; -import Experience from './Logo/Experience'; -import Idea from './Logo/Idea'; -import Expert from './Logo/Expert'; +import React from "react"; +import FlareComponent from "../Home/FlareComponent"; +import Connection from "./Logo/Connection"; +import Coupon from "./Logo/Coupon"; +import Internship from "./Logo/Internship"; +import Experience from "./Logo/Experience"; +import Idea from "./Logo/Idea"; +import Expert from "./Logo/Expert"; const Benefits = () => { - return ( -
-
-

- Benefits -

-
- -
-

- When you join our club, you'll gain unique experiences, build valuable connections, and much more. -

-
-
- -

Connection

-

- Our partners provide valuable connections that can help broaden your - professional network. By collaborating with us. -

-
+ return ( +
+
+

+ Benefits +

+
+ +
+

+ When you join our club, you'll gain unique experiences, build + valuable connections, and much more. +

+
+
+ +

Connection

+

+ Our partners provide valuable connections that can help broaden + your professional network. By collaborating with us. +

+
-
- -

Coupon

-

- As part of our collaboration, you will receive exclusive coupons that - offer special privileges to join the event or special discount. -

-
+
+ +

Coupon

+

+ As part of our collaboration, you will receive exclusive coupons + that offer special privileges to join the event or special + discount. +

+
-
- -

Internship

-

- We offer opportunities for internships with leading blockchain - companies. -

-
+
+ +

Internship

+

+ We offer opportunities for internships with leading blockchain + companies. +

+
-
- -

Experience

-

- Working with blockchain followers provides a unique experience in - Community Engagement. -

-
-
- -

- Idea to Impact -

-

- Collaborating with us gives you the chance to create and develop new - projects. -

-
-
- -

- Expert Insight -

-

- Benefit from the opportunity to receive valuable advice from industry - experts and speakers. -

-
-
-
- +
+ +

Experience

+

+ Working with blockchain followers provides a unique experience in + Community Engagement. +

+
+
+ +

+ Idea to Impact +

+

+ Collaborating with us gives you the chance to create and develop + new projects. +

+
+
+ +

+ Expert Insight +

+

+ Benefit from the opportunity to receive valuable advice from + industry experts and speakers. +

+
- ); +
+ +
+ ); }; export default Benefits; diff --git a/src/components/Community/ReviewFromUs.tsx b/src/components/Community/ReviewFromUs.tsx index f2a2c21..6bb3301 100644 --- a/src/components/Community/ReviewFromUs.tsx +++ b/src/components/Community/ReviewFromUs.tsx @@ -1,17 +1,22 @@ -"use client" +"use client"; -import React from 'react'; -import FlareComponent from '../Home/FlareComponent'; +import React from "react"; +import FlareComponent from "../Home/FlareComponent"; const ReviewFromUs = () => { return (
-

Explore new interests, make friends, and enjoy exciting activities.

-

There's always something happening at our club. Be part of the blockchain adventure!

+

+ Explore new interests, make friends, and enjoy exciting activities. +

+

+ There 's always something happening at our club. Be part of the + blockchain adventure! +

Review From Us

-
+
@@ -26,9 +31,9 @@ const ReviewFromUs = () => {

Cat cat

cat president

- Message balak balak Message balak balak Message balak balak - Message balak balak Message balak balak Message balak balak - Message balak balak Message + Message balak balak Message balak balak Message balak balak Message + balak balak Message balak balak Message balak balak Message balak + balak Message

@@ -42,9 +47,9 @@ const ReviewFromUs = () => {

Cat cat

cat designer

- Message balak balak Message balak balak Message balak balak - Message balak balak Message balak balak Message balak balak - Message balak balak Message + Message balak balak Message balak balak Message balak balak Message + balak balak Message balak balak Message balak balak Message balak + balak Message

@@ -58,19 +63,23 @@ const ReviewFromUs = () => {

Cat cat

cat president

- Message balak balak Message balak balak Message balak balak - Message balak balak Message balak balak Message balak balak - Message balak balak Message + Message balak balak Message balak balak Message balak balak Message + balak balak Message balak balak Message balak balak Message balak + balak Message

+ .text-gradient { + background: linear-gradient( + 90deg, + rgba(238, 0, 153, 1) 0%, + rgba(0, 212, 255, 1) 100% + ); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + `}
); }; diff --git a/src/components/Home/Background/MainBackground.tsx b/src/components/Home/Background/MainBackground.tsx deleted file mode 100644 index a1a766d..0000000 --- a/src/components/Home/Background/MainBackground.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import Image from "next/image"; - -export default function MainBackground() { - const stars = [ - { top: "4%", left: "10%", width: 50, height: 50 }, - { top: "10%", left: "3%", width: 100, height: 150, rotate: 50 }, - { top: "31%", left: "2%", width: 75, height: 75 }, - { top: "20%", left: "25%", width: 100, height: 150 }, - { top: "7%", left: "30%", width: 50, height: 50 }, - { top: "0%", right: "3%", width: 150, height: 150 }, - { top: "25%", right: "10%", width: 100, height: 150 }, - { top: "5%", right: "20%", width: 100, height: 150 }, - { top: "20%", right: "28%", width: 100, height: 150 }, - { top: "40%", right: "30%", width: 80, height: 80, rotate: 20 }, - ]; - - return ( -
- Left Cloud - - {stars.map((star, index) => ( - Star - ))} - -
- Light -
- -
- Moon -
- -
- Logo -
- -
- Logo -
- -
- Logo -
- - Right Cloud -
- ); -} diff --git a/src/components/Home/Blockathon.tsx b/src/components/Home/Blockathon.tsx index 5700be4..2a6af2a 100644 --- a/src/components/Home/Blockathon.tsx +++ b/src/components/Home/Blockathon.tsx @@ -22,14 +22,14 @@ const Blockathon = () => { The CUBS Blockathon is a hackathon designed to bring together participants who will use blockchain technology to address real-world problems and create practical solutions. This event - focuses on applying blockchain's capabilities to improve everyday - life, aiming to turn these ideas into viable business models. - Participants are encouraged to think creatively and collaboratively, - exploring how blockchain can be integrated into various industries - to revolutionize processes, enhance transparency, and build more - efficient systems. The goal is to foster innovation and drive the - development of blockchain-powered solutions that have a meaningful - impact on people's lives. + focuses on applying blockchain's capabilities to improve + everyday life, aiming to turn these ideas into viable business + models. Participants are encouraged to think creatively and + collaboratively, exploring how blockchain can be integrated into + various industries to revolutionize processes, enhance transparency, + and build more efficient systems. The goal is to foster innovation + and drive the development of blockchain-powered solutions that have + a meaningful impact on people's lives.

diff --git a/src/components/User/UserInfo.tsx b/src/components/User/UserInfo.tsx deleted file mode 100644 index 2947dcd..0000000 --- a/src/components/User/UserInfo.tsx +++ /dev/null @@ -1,130 +0,0 @@ -"use client" - -import { useEffect, useState } from 'react'; -import { ethers } from 'ethers'; - -const logoPath = '/img/Logo/CUBSlogo.png'; - -export default function UserInfoPage() { - const [account, setAccount] = useState(null); - const [balance, setBalance] = useState(null); - const [network, setNetwork] = useState(null); - const [error, setError] = useState(null); - - useEffect(() => { - const fetchData = async () => { - try { - let provider: ethers.BrowserProvider | ethers.Provider; - - if (typeof window !== 'undefined' && (window as any).ethereum) { - provider = new ethers.BrowserProvider((window as any).ethereum); - - // Directly assert that provider is BrowserProvider - const signer = await (provider as ethers.BrowserProvider).getSigner(); - - // Fetch the account - const accounts = await (window as any).ethereum.request({ - method: 'eth_accounts', - }); - - if (accounts.length > 0) { - const account = accounts[0]; - setAccount(account); - localStorage.setItem('connectedAccount', account); - - // Fetch the balance using the provider - const balance = await provider.getBalance(account); - setBalance(ethers.formatEther(balance)); // Convert from wei to ether - - // Fetch the network - const network = await provider.getNetwork(); - setNetwork(network.name); - } else { - setAccount(null); - } - } else { - console.log('MetaMask not installed; using read-only defaults'); - provider = ethers.getDefaultProvider(); // No error here - } - } catch (error) { - console.error('Error:', error); - setError('Failed to fetch user information.'); - } - }; - - fetchData(); - }, []); - - const logoutMetaMask = () => { - setAccount(null); - setBalance(null); - setNetwork(null); - localStorage.removeItem('connectedAccount'); - console.log('Logged out from MetaMask'); - }; - - const handleChangeAvatar = () => { - alert('Change Avatar functionality is not implemented yet!'); - }; - - if (!account) { - return ( -
- Try reconnecting MetaMask again. -
- ); - } - - return ( -
- {/* Profile Section - First Column */} -
- CUBS Logo - -
- - {/* User Information Section - Second and Third Columns */} -
-

User Information

- {error &&

{error}

} -
-
-

Connected Address:

-

- {account} -

-
-
-

Balance:

-

- {balance ? `${balance} ETH` : 'Fetching balance...'} -

-
-
-

Network:

-

- {network || 'Fetching network...'} -

-
-
- - {/* Logout Button */} - -
-
- ); -} \ No newline at end of file