Skip to content

Commit 2ebc5d2

Browse files
authored
Merge pull request #5 from iranpsc/develop2
Develop2
2 parents c51d16f + 874be3d commit 2ebc5d2

41 files changed

Lines changed: 959 additions & 549 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "2.0.2",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev -p 5175",
6+
"dev": "next dev -p 5176",
77
"build": "next build",
88
"start": "next start -p 5175",
99
"lint": "next lint",

public/svg/level/development.svg

Lines changed: 9 additions & 0 deletions
Loading

public/svg/level/income.svg

Lines changed: 9 additions & 0 deletions
Loading

public/svg/level/orders.svg

Lines changed: 9 additions & 0 deletions
Loading

public/svg/level/update.svg

Lines changed: 9 additions & 0 deletions
Loading

public/svg/levels.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export default async function citizenSinglePage({
2929
}
3030

3131
const profileData = await getUserData();
32-
33-
console.log('profileDat1111a',profileData);
32+
console.log('profileData123',profileData.data);
33+
3434

3535

3636

@@ -76,8 +76,13 @@ export default async function citizenSinglePage({
7676

7777
//to make description less than 200 character
7878
async function makeLessCharacter(){
79-
let temp = profileData.data.customs.about
80-
temp = temp.slice(0,200)
79+
let temp;
80+
if(profileData.data?.customs?.about){
81+
temp = profileData.data.customs.about
82+
temp = temp.slice(0,200)
83+
}else(
84+
temp = ""
85+
)
8186
return temp
8287
}
8388

@@ -89,7 +94,7 @@ export default async function citizenSinglePage({
8994
return item.url
9095
}),
9196
"url": `http://rgb.irpsc.com/fa/citizen/${params.id}`,
92-
"jobTitle": `${profileData.data.customs.occupation}`,
97+
"jobTitle": `${profileData.data?.customs?.occupation}`,
9398
"description": `${await makeLessCharacter()}`,
9499
"birthDate": `${profileData.data.kyc.birth_date}`,
95100
"email": `${profileData.data.kyc.email}`,
@@ -224,8 +229,13 @@ export async function generateMetadata({ params }) {
224229

225230
//to make description less than 200 character
226231
async function makeLessCharacter(){
227-
let temp = profileData.data.customs.about
228-
temp = temp.slice(0,200)
232+
let temp;
233+
if(profileData.data?.customs?.about){
234+
temp = profileData.data.customs.about
235+
temp = temp.slice(0,200)
236+
}else(
237+
temp = ""
238+
)
229239
return temp
230240
}
231241

@@ -235,11 +245,10 @@ export async function generateMetadata({ params }) {
235245
openGraph: {
236246
// site_name:'',
237247
type: 'profile',
238-
// url: `https://yourwebsite.com/posts/${params.id}`,
239248
title: `${profileData.data.name}`,
240249
description: `${await makeLessCharacter()}`,
241250
locale: params.code == 'fa'? 'fa_IR' : 'en_US',
242-
url: `http://rgb.irpsc.com/fa/citizen/${params.id}`,
251+
url: `https://rgb.irpsc.com/${params.lang}/citizen/${params.id}`,
243252
profile: {
244253
first_name: `${profileData.data.name}`, // optional: user's first name
245254
},
Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,45 @@ export default async function CitizensLayout({
1313
params,
1414
}: {
1515
children: React.ReactNode;
16-
params: { lang: "en" | "fa" };
16+
params: any;
1717
}) {
1818
const defaultTheme = useServerDarkMode();
1919

2020
//
2121
const langData = await getTranslation(params.lang);
2222
const mainData = await getMainFile(langData);
2323
const langArray = await getLangArray();
24-
// const centralPageModal = await findByModalName(mainData, "central-page");
25-
// const tabsMenu = await findByTabName(centralPageModal, "before-login");
24+
const centralPageModal = await findByModalName(mainData, "central-page");
25+
const tabsMenu = await findByTabName(centralPageModal, "before-login");
2626
const citizenshipProfileModal = await findByModalName(
2727
mainData,
2828
"Citizenship-profile"
2929
);
30-
const tabsMenu = await findByTabName(citizenshipProfileModal, "menu");
30+
// const tabsMenu = await findByTabName(citizenshipProfileModal, "menu");
3131

3232
const staticMenuToShow = [
33-
{ name: "home", url: `/`, order: "-1" },
34-
{ name: "citizens", url: "/citizen", order: "-1" },
35-
// { name: "list of levels", url: "/levels/citizen", order: "-1" },
36-
{ name: "property", url: "" },
37-
{ name: "real estate", url: "" },
38-
{ name: "structures", url: "" },
39-
{ name: "belongings", url: "" },
40-
{ name: "permissions", url: "" },
41-
{ name: "invitations", url: "" },
42-
{ name: "transaction", url: "" },
43-
{ name: "reward", url: "" },
44-
{ name: "dynasty", url: "" },
45-
{ name: "connections", url: "" },
46-
{ name: "crimes", url: "" },
47-
{ name: "news", url: "" },
48-
{ name: "articles", url: "" },
49-
{ name: "trainings", url: "" },
50-
{ name: "about", url: "" },
51-
{ name: "contact", url: "" },
52-
{ name: "version", url: "" },
53-
{ name: "calendar", url: "" },
54-
{ name: "overview", url: "" },
33+
{ name: "home", url: ``, order: "-1" },
34+
{ name: "citizens", url: "citizens", order: "-1" },
35+
{ name: "list of levels", url: "levels/citizen", order: "-1" },
36+
{ name: "property" },
37+
{ name: "real estate" },
38+
{ name: "structures" },
39+
{ name: "belongings" },
40+
{ name: "permissions" },
41+
{ name: "invitations" },
42+
{ name: "transaction" },
43+
{ name: "reward" },
44+
{ name: "dynasty" },
45+
{ name: "connections" },
46+
{ name: "crimes" },
47+
{ name: "news" },
48+
{ name: "articles" },
49+
{ name: "trainings" },
50+
{ name: "about" },
51+
{ name: "contact" },
52+
{ name: "version" },
53+
{ name: "calendar" },
54+
{ name: "overview" },
5555
];
5656

5757
// add staticMenuToShow values to siblings tabsMenu values
@@ -63,6 +63,7 @@ export default async function CitizensLayout({
6363
tab.toShow = true;
6464
}
6565
});
66+
console.log("params4", params);
6667

6768
return (
6869
<main className="flex h-screen dark:bg-black" dir={langData.direction}>
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ export async function generateMetadata({ params }) {
4444
title: await localFind("citizens of the metaverse"),
4545
description: await makeLessCharacter(),
4646
openGraph: {
47-
// type: 'article',
47+
type: 'website',
4848
// url: `https://yourwebsite.com/posts/${params.id}`,
4949
title: await localFind("citizens of the metaverse"),
5050
description: await makeLessCharacter(),
5151
locale: params.code == "fa" ? "fa_IR" : "en_US",
5252
// site_name: متاورس رنگ,
53-
url: "",
53+
url: `https://rgb.irpsc.com/${params.lang}/citizen`,
5454
images: [
5555
{
5656
url: "/logo.png",
@@ -131,12 +131,14 @@ export default async function CitizensPage({ params }) {
131131
/>
132132

133133
{/* Breadcrumb */}
134-
<BreadCrumb params={params} />
135-
<div className="xl:px-32 lg:px-32 md:px-5 sm:px-5 xs:px-1">
134+
<div className="px-12">
135+
<BreadCrumb params={params} />
136+
</div>
137+
<div className="mt-[60px] lg:mt-[40px] xl:px-32 lg:px-32 md:px-5 sm:px-5 xs:px-1">
136138
<h2 className="font-rokh font-bold text-[24px] sm:text-[26px] md:text-[28px] lg:text-[30px] xl:text-[32px] text-center dark:text-white mt-[64px] mb-[16px]">
137139
{localFind("citizens of the metaverse")}
138140
</h2>
139-
<p className="text-lightGrey dark:text-lightGray font-azarMehr font-normal text-[16px] sm:text-[18px] md:text-[20px] lg:text-[22px] xl:text-[24px] text-center text-justify">
141+
<p className="text-lightGrey dark:text-darkGray font-azarMehr font-normal text-[16px] sm:text-[18px] md:text-[20px] lg:text-[22px] xl:text-[24px] text-center text-justify">
140142
{localFind("description citizen list")}
141143
</p>
142144
<div className="flex justify-center w-full">

src/app/[lang]/levels/citizen/[levelName]/[tabs]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default async function CitizensLayout({
1313
params,
1414
}: {
1515
children: React.ReactNode;
16-
params: { lang: "en" | "fa" };
16+
params: any;
1717
}) {
1818
const defaultTheme = useServerDarkMode();
1919

0 commit comments

Comments
 (0)