Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
summerhasuna committed Sep 30, 2024
1 parent ec2c111 commit 0bd5410
Show file tree
Hide file tree
Showing 7 changed files with 819 additions and 552 deletions.
18 changes: 12 additions & 6 deletions src/app/competents/editorCtp/PreviewCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ interface PreviewCodeProps {
datethree: string;
backgroundColorCounterthree: string;
checkactivethree: string;
offerSelect: string;
offerSelectTwo: string;
offerSelectThree: string;
}

const PreviewCodeCtp: React.FC<PreviewCodeProps> = ({
Expand Down Expand Up @@ -101,6 +104,9 @@ const PreviewCodeCtp: React.FC<PreviewCodeProps> = ({
datethree,
backgroundColorCounterthree,
checkactivethree,
offerSelect,
offerSelectTwo,
offerSelectThree,
}) => {
const beautifyJson = (jsonData: string) => {
const beautifiedJson = beautify(jsonData, {
Expand Down Expand Up @@ -180,7 +186,7 @@ ${
select
? `,"coupons": [ ${
select == "1"
? linetext
? linetext && offerSelect !== "Choose offer"
? `{
${linetext.length <= 30 ? `"title": "${linetext}"` : ""}
${code ? `,"code":"${code}"` : ""}
Expand Down Expand Up @@ -240,7 +246,7 @@ ${
${
select == "2"
select == "2" && offerSelect !== "Choose offer"
? `
${
linetext
Expand Down Expand Up @@ -295,7 +301,7 @@ ${
: ""
}
${
linetexttwo.length <= 30
linetexttwo.length <= 30 && offerSelectTwo !== "Choose offer"
? ` ,{
"title": "${linetexttwo}"
${codeTwo ? `,"code":"${codeTwo}"` : ""}
Expand Down Expand Up @@ -355,7 +361,7 @@ ${
select == "3"
? `
${
linetext.length <= 30
linetext.length <= 30 && offerSelect !== "Choose offer"
? `{
${linetext ? `"title": "${linetext}"` : ""}
${code ? `,"code":"${code}"` : ""}
Expand Down Expand Up @@ -401,7 +407,7 @@ ${
: ""
}
${
linetexttwo.length <= 30
linetexttwo.length <= 30 && offerSelectTwo !== "Choose offer"
? `,{
"title": "${linetexttwo}"
${codeTwo ? `,"code":"${codeTwo}"` : ""}
Expand Down Expand Up @@ -459,7 +465,7 @@ ${
}
${
linetextthree.length <= 30
linetextthree.length <= 30 && offerSelectThree !== "Choose offer"
? ` ,{
"title": "${linetextthree}"
${codeThree ? `,"code":"${codeThree}"` : ""}
Expand Down
Loading

0 comments on commit 0bd5410

Please sign in to comment.