Commit 0cd60c90 by Arjun Jhukal

updated the meta data for the game

parent 5d57629f
......@@ -69,109 +69,109 @@ jobs:
# pm2 start ecosystem.config.js --env production
# EOF
- name: Notify Slack on Success
if: success()
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
"text": "✅ getFirekirin Deployment Successful!",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "✅ getFirekirin Deployment Successful"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:*\n${{ github.repository }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n${{ github.ref_name }}"
},
{
"type": "mrkdwn",
"text": "*Commit:*\n<${{ github.event.head_commit.url }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
"text": "*Author:*\n${{ github.actor }}"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Message:* ${{ github.event.head_commit.message }}"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Deployed to production at <!date^${{ github.event.head_commit.timestamp }}^{date_num} {time_secs}|${{ github.event.head_commit.timestamp }}>"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
# - name: Notify Slack on Success
# if: success()
# uses: slackapi/slack-github-action@v1.27.0
# with:
# payload: |
# {
# "text": "✅ getFirekirin Deployment Successful!",
# "blocks": [
# {
# "type": "header",
# "text": {
# "type": "plain_text",
# "text": "✅ getFirekirin Deployment Successful"
# }
# },
# {
# "type": "section",
# "fields": [
# {
# "type": "mrkdwn",
# "text": "*Repository:*\n${{ github.repository }}"
# },
# {
# "type": "mrkdwn",
# "text": "*Branch:*\n${{ github.ref_name }}"
# },
# {
# "type": "mrkdwn",
# "text": "*Commit:*\n<${{ github.event.head_commit.url }}|${{ github.sha }}>"
# },
# {
# "type": "mrkdwn",
# "text": "*Author:*\n${{ github.actor }}"
# }
# ]
# },
# {
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": "*Message:* ${{ github.event.head_commit.message }}"
# }
# },
# {
# "type": "context",
# "elements": [
# {
# "type": "mrkdwn",
# "text": "Deployed to production at <!date^${{ github.event.head_commit.timestamp }}^{date_num} {time_secs}|${{ github.event.head_commit.timestamp }}>"
# }
# ]
# }
# ]
# }
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- name: Notify Slack on Failure
if: failure()
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
"text": "❌ getFirekirin Deployment Failed!",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "❌ getFirekirin Deployment Failed"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:*\n${{ github.repository }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n${{ github.ref_name }}"
},
{
"type": "mrkdwn",
"text": "*Commit:*\n<${{ github.event.head_commit.url }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
"text": "*Author:*\n${{ github.actor }}"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Action:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow Run>"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
# - name: Notify Slack on Failure
# if: failure()
# uses: slackapi/slack-github-action@v1.27.0
# with:
# payload: |
# {
# "text": "❌ getFirekirin Deployment Failed!",
# "blocks": [
# {
# "type": "header",
# "text": {
# "type": "plain_text",
# "text": "❌ getFirekirin Deployment Failed"
# }
# },
# {
# "type": "section",
# "fields": [
# {
# "type": "mrkdwn",
# "text": "*Repository:*\n${{ github.repository }}"
# },
# {
# "type": "mrkdwn",
# "text": "*Branch:*\n${{ github.ref_name }}"
# },
# {
# "type": "mrkdwn",
# "text": "*Commit:*\n<${{ github.event.head_commit.url }}|${{ github.sha }}>"
# },
# {
# "type": "mrkdwn",
# "text": "*Author:*\n${{ github.actor }}"
# }
# ]
# },
# {
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": "*Action:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow Run>"
# }
# }
# ]
# }
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
......@@ -7,8 +7,21 @@ const SITE_URL = process.env.NEXT_PUBLIC_FRONTEND_URL!;
export async function generateMetadata(props: { params: Promise<{ id: string }> }): Promise<Metadata> {
const { id } = await props.params;
const canonicalUrl = `${SITE_URL}/exclusive-games/${id}`.replace(/\/$/, "");
const game = await getSingleGame(id);
return {
title: game?.data?.meta?.meta_title || game?.data?.name,
description: game?.data?.meta?.meta_description || game?.data?.name,
openGraph: {
title: game?.data?.meta?.meta_title || game?.data?.name,
description: game?.data?.meta?.meta_description || game?.data?.name,
images: game?.data?.meta?.og_image_url
},
twitter: {
title: game?.data?.meta?.meta_title || game?.data?.name,
description: game?.data?.meta?.meta_description || game?.data?.name,
images: game?.data?.meta?.og_image_url
},
alternates: {
canonical: canonicalUrl,
},
......
......@@ -49,15 +49,16 @@ export default function ActionGroup({
{({ TransitionProps }) => (
<Fade {...TransitionProps} timeout={300}>
<Paper
elevation={3}
sx={{
width: 215,
borderRadius: 2,
mt: 1,
p: 0,
overflow: "hidden"
}}
>
<ClickAwayListener onClickAway={handleClose}>
<List>
<List className='p-0!'>
{onView ? <ListItem>
<Link href={onView || ""} className='block py-3 px-4 hover:bg-[#FBF4FB]'>View Profile</Link>
</ListItem> : ""}
......
import { GameProps } from "@/types/game";
import { InputLabel, OutlinedInput } from "@mui/material";
import { FormikProps } from "formik";
import InputFile from "../atom/InputFile";
export default function MetaDescription({
formik,
}: {
formik: FormikProps<GameProps>;
}) {
return (
<div className="form__field__wrapper border border-gray rounded-[16px] mb-6">
<div className="form__title py-6 px-10 border-b border-gray">
<h2 className="text-[20px] leading-[140%] font-bold">
SEO Setting
</h2>
</div>
<div className="form__fields p-6 lg:p-10 flex flex-col gap-4 lg:gap-6">
{/* Meta Title */}
<div className="input__field">
<InputLabel htmlFor="meta.meta_title">Meta Title</InputLabel>
<OutlinedInput
fullWidth
id="meta.meta_title"
name="meta.meta_title"
placeholder="Enter the Meta Title"
value={formik.values.meta?.meta_title || ""}
onChange={formik.handleChange}
onBlur={formik.handleBlur}
/>
</div>
{/* Meta Description */}
<div className="input__field">
<InputLabel htmlFor="meta.meta_description">
Meta Description
</InputLabel>
<OutlinedInput
fullWidth
id="meta.meta_description"
name="meta.meta_description"
placeholder="Enter the SEO Description"
value={formik.values.meta?.meta_description || ""}
onChange={formik.handleChange}
onBlur={formik.handleBlur}
multiline
minRows={3}
/>
</div>
{/* Meta Image */}
<div className="input__field">
<InputFile
name="meta.og_image"
label="Thumbnail of the Game"
value={formik.values.meta?.og_image || null}
onChange={(file: File | File[] | null) =>
formik.setFieldValue("meta.og_image", file)
}
onBlur={() =>
formik.setFieldTouched("meta.og_image", true)
}
serverFile={formik.values.meta?.og_image_url}
onRemoveServerFile={() =>
formik.setFieldValue("meta.og_image_url", undefined)
}
/>
</div>
</div>
</div>
);
}
......@@ -160,7 +160,7 @@ export default function AdminMenu({ open }: { open: boolean }) {
>
<Link
href={href}
className={`flex gap-2 items-start px-4 py-2 ${open ? "expanded" : "collapsed"
className={`flex gap-2 items-center px-4 py-2 ${open ? "expanded" : "collapsed"
} ${active ? "active__menu" : ""}`}
>
<ListItemIcon className={open ? "expanded" : "collapsed"}>
......
......@@ -2,6 +2,7 @@
import InputFile from "@/components/atom/InputFile";
import SelectField from "@/components/atom/SelectField";
import ReactQuillEditor from "@/components/molecules/ReactQuill";
import MetaDescription from "@/components/organism/Meta";
import { useAppDispatch } from "@/hooks/hook";
import { PATH } from "@/routes/PATH";
import { useAddGameMutation, useGetGameByIdQuery, useUpdateGameByIdMutation } from "@/services/gameApi";
......@@ -76,6 +77,20 @@ export default function AddGameForm({ id }: AddGameFormProps) {
formData.append("description", values.description);
formData.append("api", values.api);
formData.append("provider", values.provider);
if (values.meta) {
if (values.meta.meta_title) {
formData.append("meta[meta_title]", values.meta.meta_title);
}
if (values.meta.meta_description) {
formData.append("meta[meta_description]", values.meta.meta_description);
}
if (values.meta.og_image) {
formData.append("meta[og_image]", values.meta.og_image);
}
if (values.meta.og_image_url) {
formData.append("meta[og_image_url]", values.meta.og_image_url);
}
}
if (values.profit) formData.append("profit", values.profit);
if (values.thumbnail instanceof File) {
......@@ -153,14 +168,13 @@ export default function AddGameForm({ id }: AddGameFormProps) {
}
};
return (
<form onSubmit={formik.handleSubmit}>
<MetaDescription formik={formik} />
<div className="form__field__wrapper border-solid border-[1px] border-gray rounded-[16px] mb-6">
<div className="form__title py-6 px-10 border-b-solid border-b-[1px] border-gray">
<h2 className="text-[20px] leading-[140%] font-bold">Overview of the Game</h2>
</div>
<div className="form__fields p-6 lg:p-10 flex flex-col gap-4 lg:gap-6 ">
{/* Name */}
<div className="input__field">
......@@ -276,6 +290,7 @@ export default function AddGameForm({ id }: AddGameFormProps) {
</div>
</div>
{/* Game Configuration */}
<div className="form__field__wrapper border-solid border-[1px] border-gray rounded-[16px]">
<div className="form__title py-6 px-10 border-b-solid border-b-[1px] border-gray">
......
......@@ -2,6 +2,7 @@
import ActionGroup from '@/components/molecules/Action';
import { useAppDispatch } from '@/hooks/hook';
import { PATH } from '@/routes/PATH';
import { useDeleteGameByIdMutation, useGetAllGamesQuery } from '@/services/gameApi';
import { showToast, ToastVariant } from '@/slice/toastSlice';
import { GameItem } from '@/types/game';
......@@ -59,6 +60,7 @@ export default function AdminGameList() {
{game.name}
</h2>
<ActionGroup
onEdit={`${PATH.ADMIN.GAMES.EDIT_GAME.ROOT}/${game?.id}`}
onDelete={async () => {
try {
......
export interface MetaProps {
meta_title: string;
meta_description: string;
og_image: File | null;
og_image_url?: string;
}
export interface FileResponse {
file_name: string;
mime_type: string;
......@@ -7,7 +14,7 @@ export interface FileResponse {
export interface CommonGameProps {
name: string;
category?: string;
meta?: MetaProps,
description: string;
api: string;
provider: string;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment