+
+
+
+
-
-
-
-
-
Chọn Quốc Gia
-
- {flags.map((v) => (
- // TODO: Chưa làm được phần Start Icon là Flag
- {v}
- ))}
-
-
+
+
+
+
+
+
+
-
-
- Chọn Ảnh Đại Diện
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ Chọn Quốc Gia
+
+
+ {flags.map((v) => (
+ // TODO: Chưa làm được phần Start Icon là Flag
+ {v}
+ ))}
+
+
+
+
+
+ Chọn Ảnh Đại Diện
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- Cập Nhật
-
+
+
+ Cập Nhật
+
+
+
+
+
-
-
-
-
-
-
-
-
Bạn Bè
-
(window as any).modal_add_friend.showModal()}
- />
-
-
-
-
- )
+ )
}
interface PlayerData {
- username: string
- avatarSrc: string
- flagSrc: string
- status: "Rảnh tay" | "Đang chơi" | "Ngoại tuyến"
- score: number
+ username: string
+ avatarSrc: string
+ flagSrc: string
+ status: 'Rảnh tay' | 'Đang chơi' | 'Ngoại tuyến'
+ score: number
}
const players: PlayerData[] = [
- {
- username: "Player 1",
- avatarSrc: "/assets/avatars/avatar1.png",
- flagSrc: "/assets/flags/VN.svg",
- status: "Ngoại tuyến",
- score: 140,
- },
- {
- username: "Player 2",
- avatarSrc: "/assets/avatars/avatar2.png",
- flagSrc: "/assets/flags/BO.svg",
- status: "Đang chơi",
- score: 130,
- },
- {
- username: "Player 3",
- avatarSrc: "/assets/avatars/avatar3.png",
- flagSrc: "/assets/flags/AC.svg",
- status: "Rảnh tay",
- score: 242,
- },
- {
- username: "Player 4",
- avatarSrc: "/assets/avatars/avatar4.png",
- flagSrc: "/assets/flags/VN.svg",
- status: "Đang chơi",
- score: 45,
- },
- {
- username: "Player 5",
- avatarSrc: "/assets/avatars/avatar5.png",
- flagSrc: "/assets/flags/AZ.svg",
- status: "Đang chơi",
- score: 1314,
- },
- {
- username: "Player 6",
- avatarSrc: "/assets/avatars/avatar6.png",
- flagSrc: "/assets/flags/VN.svg",
- status: "Ngoại tuyến",
- score: 4564,
- },
- {
- username: "Player 7",
- avatarSrc: "/assets/avatars/avatar6.png",
- flagSrc: "/assets/flags/VN.svg",
- status: "Rảnh tay",
- score: 884,
- },
+ {
+ username: 'Player 1',
+ avatarSrc: '/assets/avatars/avatar1.png',
+ flagSrc: '/assets/flags/VN.svg',
+ status: 'Ngoại tuyến',
+ score: 140,
+ },
+ {
+ username: 'Player 2',
+ avatarSrc: '/assets/avatars/avatar2.png',
+ flagSrc: '/assets/flags/BO.svg',
+ status: 'Đang chơi',
+ score: 130,
+ },
+ {
+ username: 'Player 3',
+ avatarSrc: '/assets/avatars/avatar3.png',
+ flagSrc: '/assets/flags/AC.svg',
+ status: 'Rảnh tay',
+ score: 242,
+ },
+ {
+ username: 'Player 4',
+ avatarSrc: '/assets/avatars/avatar4.png',
+ flagSrc: '/assets/flags/VN.svg',
+ status: 'Đang chơi',
+ score: 45,
+ },
+ {
+ username: 'Player 5',
+ avatarSrc: '/assets/avatars/avatar5.png',
+ flagSrc: '/assets/flags/AZ.svg',
+ status: 'Đang chơi',
+ score: 1314,
+ },
+ {
+ username: 'Player 6',
+ avatarSrc: '/assets/avatars/avatar6.png',
+ flagSrc: '/assets/flags/VN.svg',
+ status: 'Ngoại tuyến',
+ score: 4564,
+ },
+ {
+ username: 'Player 7',
+ avatarSrc: '/assets/avatars/avatar6.png',
+ flagSrc: '/assets/flags/VN.svg',
+ status: 'Rảnh tay',
+ score: 884,
+ },
]
// TODO: Sẽ cập nhật thành object chứa value & icon
const flags = [
- "Afghanistan",
- "Åland Islands",
- "Albania",
- "Algeria",
- "American Samoa",
- "Andorra",
- "Angola",
- "Anguilla",
- "Antarctica",
- "Antigua and Barbuda",
- "Argentina",
- "Armenia",
- "Aruba",
- "Australia",
- "Austria",
- "Azerbaijan",
- "Bahamas",
- "Bahrain",
- "Bangladesh",
- "Barbados",
- "Belarus",
- "Belgium",
- "Belize",
- "Benin",
- "Bermuda",
- "Bhutan",
- "Bolivia (Plurinational State of)",
- "Bonaire, Sint Eustatius and Saba",
- "Bosnia and Herzegovina",
- "Botswana",
- "Bouvet Island",
- "Brazil",
- "British Indian Ocean Territory",
- "Brunei Darussalam",
- "Bulgaria",
- "Burkina Faso",
- "Burundi",
- "Cabo Verde",
- "Cambodia",
- "Cameroon",
- "Canada",
- "Cayman Islands",
- "Central African Republic",
- "Chad",
- "Chile",
- "China",
- "Christmas Island",
- "Cocos (Keeling) Islands",
- "Colombia",
- "Comoros",
- "Congo",
- "Congo, Democratic Republic of the",
- "Cook Islands",
- "Costa Rica",
- "Côte d'Ivoire",
- "Croatia",
- "Cuba",
- "Curaçao",
- "Cyprus",
- "Czechia",
- "Denmark",
- "Djibouti",
- "Dominica",
- "Dominican Republic",
- "Ecuador",
- "Egypt",
- "El Salvador",
- "Equatorial Guinea",
- "Eritrea",
- "Estonia",
- "Eswatini",
- "Ethiopia",
- "Falkland Islands (Malvinas)",
- "Faroe Islands",
- "Fiji",
- "Finland",
- "France",
- "French Guiana",
- "French Polynesia",
- "French Southern Territories",
- "Gabon",
- "Gambia",
- "Georgia",
- "Germany",
- "Ghana",
- "Gibraltar",
- "Greece",
- "Greenland",
- "Grenada",
- "Guadeloupe",
- "Guam",
- "Guatemala",
- "Guernsey",
- "Guinea",
- "Guinea-Bissau",
- "Guyana",
- "Haiti",
- "Heard Island and McDonald Islands",
- "Holy See",
- "Honduras",
- "Hong Kong",
- "Hungary",
- "Iceland",
- "India",
- "Indonesia",
- "Iran (Islamic Republic of)",
- "Iraq",
- "Ireland",
- "Isle of Man",
- "Israel",
- "Italy",
- "Jamaica",
- "Japan",
- "Jersey",
- "Jordan",
- "Kazakhstan",
- "Kenya",
- "Kiribati",
- "Korea (Democratic People's Republic of)",
- "Korea, Republic of",
- "Kuwait",
- "Kyrgyzstan",
- "Lao People's Democratic Republic",
- "Latvia",
- "Lebanon",
- "Lesotho",
- "Liberia",
- "Libya",
- "Liechtenstein",
- "Lithuania",
- "Luxembourg",
- "Macao",
- "Madagascar",
- "Malawi",
- "Malaysia",
- "Maldives",
- "Mali",
- "Malta",
- "Marshall Islands",
- "Martinique",
- "Mauritania",
- "Mauritius",
- "Mayotte",
- "Mexico",
- "Micronesia (Federated States of)",
- "Moldova, Republic of",
- "Monaco",
- "Mongolia",
- "Montenegro",
- "Montserrat",
- "Morocco",
- "Mozambique",
- "Myanmar",
- "Namibia",
- "Nauru",
- "Nepal",
- "Netherlands, Kingdom of the",
- "New Caledonia",
- "New Zealand",
- "Nicaragua",
- "Niger",
- "Nigeria",
- "Niue",
- "Norfolk Island",
- "North Macedonia",
- "Northern Mariana Islands",
- "Norway",
- "Oman",
- "Pakistan",
- "Palau",
- "Palestine, State of",
- "Panama",
- "Papua New Guinea",
- "Paraguay",
- "Peru",
- "Philippines",
- "Pitcairn",
- "Poland",
- "Portugal",
- "Puerto Rico",
- "Qatar",
- "Réunion",
- "Romania",
- "Russian Federation",
- "Rwanda",
- "Saint Barthélemy",
- "Saint Helena, Ascension and Tristan da Cunha",
- "Saint Kitts and Nevis",
- "Saint Lucia",
- "Saint Martin (French part)",
- "Saint Pierre and Miquelon",
- "Saint Vincent and the Grenadines",
- "Samoa",
- "San Marino",
- "Sao Tome and Principe",
- "Saudi Arabia",
- "Senegal",
- "Serbia",
- "Seychelles",
- "Sierra Leone",
- "Singapore",
- "Sint Maarten (Dutch part)",
- "Slovakia",
- "Slovenia",
- "Solomon Islands",
- "Somalia",
- "South Africa",
- "South Georgia and the South Sandwich Islands",
- "South Sudan",
- "Spain",
- "Sri Lanka",
- "Sudan",
- "Suriname",
- "Svalbard and Jan Mayen",
- "Sweden",
- "Switzerland",
- "Syrian Arab Republic",
- "Taiwan, Province of China",
- "Tajikistan",
- "Tanzania, United Republic of",
- "Thailand",
- "Timor-Leste",
- "Togo",
- "Tokelau",
- "Tonga",
- "Trinidad and Tobago",
- "Tunisia",
- "Türkiye",
- "Turkmenistan",
- "Turks and Caicos Islands",
- "Tuvalu",
- "Uganda",
- "Ukraine",
- "United Arab Emirates",
- "United Kingdom of Great Britain and Northern Ireland",
- "United States of America",
- "United States Minor Outlying Islands",
- "Uruguay",
- "Uzbekistan",
- "Vanuatu",
- "Venezuela (Bolivarian Republic of)",
- "Viet Nam",
- "Virgin Islands (British)",
- "Virgin Islands (U.S.)",
- "Wallis and Futuna",
- "Western Sahara",
- "Yemen",
- "Zambia",
- "Zimbabwe",
+ 'Afghanistan',
+ 'Åland Islands',
+ 'Albania',
+ 'Algeria',
+ 'American Samoa',
+ 'Andorra',
+ 'Angola',
+ 'Anguilla',
+ 'Antarctica',
+ 'Antigua and Barbuda',
+ 'Argentina',
+ 'Armenia',
+ 'Aruba',
+ 'Australia',
+ 'Austria',
+ 'Azerbaijan',
+ 'Bahamas',
+ 'Bahrain',
+ 'Bangladesh',
+ 'Barbados',
+ 'Belarus',
+ 'Belgium',
+ 'Belize',
+ 'Benin',
+ 'Bermuda',
+ 'Bhutan',
+ 'Bolivia (Plurinational State of)',
+ 'Bonaire, Sint Eustatius and Saba',
+ 'Bosnia and Herzegovina',
+ 'Botswana',
+ 'Bouvet Island',
+ 'Brazil',
+ 'British Indian Ocean Territory',
+ 'Brunei Darussalam',
+ 'Bulgaria',
+ 'Burkina Faso',
+ 'Burundi',
+ 'Cabo Verde',
+ 'Cambodia',
+ 'Cameroon',
+ 'Canada',
+ 'Cayman Islands',
+ 'Central African Republic',
+ 'Chad',
+ 'Chile',
+ 'China',
+ 'Christmas Island',
+ 'Cocos (Keeling) Islands',
+ 'Colombia',
+ 'Comoros',
+ 'Congo',
+ 'Congo, Democratic Republic of the',
+ 'Cook Islands',
+ 'Costa Rica',
+ "Côte d'Ivoire",
+ 'Croatia',
+ 'Cuba',
+ 'Curaçao',
+ 'Cyprus',
+ 'Czechia',
+ 'Denmark',
+ 'Djibouti',
+ 'Dominica',
+ 'Dominican Republic',
+ 'Ecuador',
+ 'Egypt',
+ 'El Salvador',
+ 'Equatorial Guinea',
+ 'Eritrea',
+ 'Estonia',
+ 'Eswatini',
+ 'Ethiopia',
+ 'Falkland Islands (Malvinas)',
+ 'Faroe Islands',
+ 'Fiji',
+ 'Finland',
+ 'France',
+ 'French Guiana',
+ 'French Polynesia',
+ 'French Southern Territories',
+ 'Gabon',
+ 'Gambia',
+ 'Georgia',
+ 'Germany',
+ 'Ghana',
+ 'Gibraltar',
+ 'Greece',
+ 'Greenland',
+ 'Grenada',
+ 'Guadeloupe',
+ 'Guam',
+ 'Guatemala',
+ 'Guernsey',
+ 'Guinea',
+ 'Guinea-Bissau',
+ 'Guyana',
+ 'Haiti',
+ 'Heard Island and McDonald Islands',
+ 'Holy See',
+ 'Honduras',
+ 'Hong Kong',
+ 'Hungary',
+ 'Iceland',
+ 'India',
+ 'Indonesia',
+ 'Iran (Islamic Republic of)',
+ 'Iraq',
+ 'Ireland',
+ 'Isle of Man',
+ 'Israel',
+ 'Italy',
+ 'Jamaica',
+ 'Japan',
+ 'Jersey',
+ 'Jordan',
+ 'Kazakhstan',
+ 'Kenya',
+ 'Kiribati',
+ "Korea (Democratic People's Republic of)",
+ 'Korea, Republic of',
+ 'Kuwait',
+ 'Kyrgyzstan',
+ "Lao People's Democratic Republic",
+ 'Latvia',
+ 'Lebanon',
+ 'Lesotho',
+ 'Liberia',
+ 'Libya',
+ 'Liechtenstein',
+ 'Lithuania',
+ 'Luxembourg',
+ 'Macao',
+ 'Madagascar',
+ 'Malawi',
+ 'Malaysia',
+ 'Maldives',
+ 'Mali',
+ 'Malta',
+ 'Marshall Islands',
+ 'Martinique',
+ 'Mauritania',
+ 'Mauritius',
+ 'Mayotte',
+ 'Mexico',
+ 'Micronesia (Federated States of)',
+ 'Moldova, Republic of',
+ 'Monaco',
+ 'Mongolia',
+ 'Montenegro',
+ 'Montserrat',
+ 'Morocco',
+ 'Mozambique',
+ 'Myanmar',
+ 'Namibia',
+ 'Nauru',
+ 'Nepal',
+ 'Netherlands, Kingdom of the',
+ 'New Caledonia',
+ 'New Zealand',
+ 'Nicaragua',
+ 'Niger',
+ 'Nigeria',
+ 'Niue',
+ 'Norfolk Island',
+ 'North Macedonia',
+ 'Northern Mariana Islands',
+ 'Norway',
+ 'Oman',
+ 'Pakistan',
+ 'Palau',
+ 'Palestine, State of',
+ 'Panama',
+ 'Papua New Guinea',
+ 'Paraguay',
+ 'Peru',
+ 'Philippines',
+ 'Pitcairn',
+ 'Poland',
+ 'Portugal',
+ 'Puerto Rico',
+ 'Qatar',
+ 'Réunion',
+ 'Romania',
+ 'Russian Federation',
+ 'Rwanda',
+ 'Saint Barthélemy',
+ 'Saint Helena, Ascension and Tristan da Cunha',
+ 'Saint Kitts and Nevis',
+ 'Saint Lucia',
+ 'Saint Martin (French part)',
+ 'Saint Pierre and Miquelon',
+ 'Saint Vincent and the Grenadines',
+ 'Samoa',
+ 'San Marino',
+ 'Sao Tome and Principe',
+ 'Saudi Arabia',
+ 'Senegal',
+ 'Serbia',
+ 'Seychelles',
+ 'Sierra Leone',
+ 'Singapore',
+ 'Sint Maarten (Dutch part)',
+ 'Slovakia',
+ 'Slovenia',
+ 'Solomon Islands',
+ 'Somalia',
+ 'South Africa',
+ 'South Georgia and the South Sandwich Islands',
+ 'South Sudan',
+ 'Spain',
+ 'Sri Lanka',
+ 'Sudan',
+ 'Suriname',
+ 'Svalbard and Jan Mayen',
+ 'Sweden',
+ 'Switzerland',
+ 'Syrian Arab Republic',
+ 'Taiwan, Province of China',
+ 'Tajikistan',
+ 'Tanzania, United Republic of',
+ 'Thailand',
+ 'Timor-Leste',
+ 'Togo',
+ 'Tokelau',
+ 'Tonga',
+ 'Trinidad and Tobago',
+ 'Tunisia',
+ 'Türkiye',
+ 'Turkmenistan',
+ 'Turks and Caicos Islands',
+ 'Tuvalu',
+ 'Uganda',
+ 'Ukraine',
+ 'United Arab Emirates',
+ 'United Kingdom of Great Britain and Northern Ireland',
+ 'United States of America',
+ 'United States Minor Outlying Islands',
+ 'Uruguay',
+ 'Uzbekistan',
+ 'Vanuatu',
+ 'Venezuela (Bolivarian Republic of)',
+ 'Viet Nam',
+ 'Virgin Islands (British)',
+ 'Virgin Islands (U.S.)',
+ 'Wallis and Futuna',
+ 'Western Sahara',
+ 'Yemen',
+ 'Zambia',
+ 'Zimbabwe',
]
export default UserInfo
diff --git a/components/account/forms/ChangePasswordForm.tsx b/components/account/forms/ChangePasswordForm.tsx
index 0ca83e2..624b582 100644
--- a/components/account/forms/ChangePasswordForm.tsx
+++ b/components/account/forms/ChangePasswordForm.tsx
@@ -1,5 +1,3 @@
-"use client"
-
import React from "react"
const ChangePasswordForm: React.FC = () => {
diff --git a/components/account/forms/UpdateEmailForm.tsx b/components/account/forms/UpdateEmailForm.tsx
index 49bf6a5..7975323 100644
--- a/components/account/forms/UpdateEmailForm.tsx
+++ b/components/account/forms/UpdateEmailForm.tsx
@@ -1,78 +1,75 @@
-"use client"
+'use client'
-import React from "react"
-import IconButton from "@/components/ui/IconButton"
-
-interface PlayerData {
- username: string
- email: string
-}
-
-const sampleData: PlayerData = {
- username: "Owlvernyte",
- email: "owlvernyte@gmail.com",
-}
+import React from 'react'
+import IconButton from '@/components/ui/IconButton'
+import useCheckAuthorization from '@/features/user/useCheckAuthorization'
const UpdateEmailForm: React.FC = () => {
- return (
-
-
- Email
-
-
-
- {sampleData.email}
-
-
(window as any).modal_update_email.showModal()}
- buttonVariants="btn-neutral"
- buttonSize="btn-lg"
- />
-
-
-
-
- Thay đổi Email
-
-
-
-
-
+ const { data: user } = useCheckAuthorization()
+
+ return (
+
+
+ Email
+
+
+
+ {user?.email ?? 'Trống'}
-
-
-
- {/* closes when clicked outside */}
-
- close
-
-
-
-
- )
+
+ (window as any).modal_update_email.showModal()
+ }
+ buttonVariants="btn-neutral"
+ buttonSize="btn-lg"
+ />
+
+
+
+
+
+ Thay đổi Email
+
+
+
+
+ {/* closes when clicked outside */}
+
+ close
+
+
+
+
+ )
}
export default UpdateEmailForm
diff --git a/components/account/forms/UpdateUsernameForm.tsx b/components/account/forms/UpdateUsernameForm.tsx
index e1e9d3c..5b31530 100644
--- a/components/account/forms/UpdateUsernameForm.tsx
+++ b/components/account/forms/UpdateUsernameForm.tsx
@@ -1,80 +1,75 @@
-"use client"
+'use client'
-import React from "react"
-import IconButton from "@/components/ui/IconButton"
-
-interface PlayerData {
- username: string
- email: string
-}
-
-const sampleData: PlayerData = {
- username: "Owlvernyte",
- email: "owlvernyte@gmail.com",
-}
+import React from 'react'
+import IconButton from '@/components/ui/IconButton'
+import useCheckAuthorization from '@/features/user/useCheckAuthorization'
const UpdateUsernameForm: React.FC = () => {
- return (
-
-
- Tên Người Dùng
-
-
-
- {sampleData.username}
-
-
(window as any).modal_update_username.showModal()}
- buttonVariants="btn-neutral"
- buttonSize="btn-lg"
- />
-
-
-
-
-
- Thay đổi Tên Người Dùng
-
-
-
-
-
-
+ const { data: user } = useCheckAuthorization()
+
+ return (
+
+
+ Tên Người Dùng
+
+
+
+ {user?.userName ?? 'Trống'}
-
-
-
- {/* closes when clicked outside */}
-
- close
-
-
-
-
- )
+
+ (window as any).modal_update_username.showModal()
+ }
+ buttonVariants="btn-neutral"
+ buttonSize="btn-lg"
+ />
+
+
+
+
+
+ Thay đổi Tên Người Dùng
+
+
+
+
+ {/* closes when clicked outside */}
+
+ close
+
+
+
+
+ )
}
export default UpdateUsernameForm