From fb36d32fa01c63ad0e9223c6772a0f636cbea409 Mon Sep 17 00:00:00 2001 From: Dev Gupta <73140257+dev265545@users.noreply.github.com> Date: Mon, 8 May 2023 01:27:15 +0530 Subject: [PATCH] Fixes : Admin: Custom emoji page layout (#2993) * Update emojis.tsx * Prettified Code! * Second Iteration * Update emojis.tsx * Putting Delete Button at top-right Will this work ? * Prettified Code! * Update emojis.tsx Changing Icon of Delete Button Decreasing Delete-Button Size * Prettified Code! * Tweak style of delete emoji button --------- Co-authored-by: dev265545 Co-authored-by: Gabe Kangas --- web/pages/admin/chat/emojis.tsx | 85 ++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 38 deletions(-) diff --git a/web/pages/admin/chat/emojis.tsx b/web/pages/admin/chat/emojis.tsx index 7cd92d446..8d9012920 100644 --- a/web/pages/admin/chat/emojis.tsx +++ b/web/pages/admin/chat/emojis.tsx @@ -1,11 +1,9 @@ -import { Button, Space, Table, Typography, Upload } from 'antd'; -import { RcFile } from 'antd/lib/upload'; +import { Avatar, Button, Card, Col, Row, Tooltip, Typography } from 'antd'; +import Upload, { RcFile } from 'antd/lib/upload'; import React, { ReactElement, useEffect, useState } from 'react'; import dynamic from 'next/dynamic'; import FormStatusIndicator from '../../../components/admin/FormStatusIndicator'; - import { DELETE_EMOJI, fetchData, UPLOAD_EMOJI } from '../../../utils/apis'; - import { ACCEPTED_IMAGE_TYPES, getBase64 } from '../../../utils/images'; import { createInputStatus, @@ -15,12 +13,12 @@ import { } from '../../../utils/input-statuses'; import { RESET_TIMEOUT } from '../../../utils/config-constants'; import { URL_CUSTOM_EMOJIS } from '../../../utils/constants'; - import { AdminLayout } from '../../../components/layouts/AdminLayout'; +const { Meta } = Card; // Lazy loaded components -const DeleteOutlined = dynamic(() => import('@ant-design/icons/DeleteOutlined'), { +const CloseOutlined = dynamic(() => import('@ant-design/icons/CloseOutlined'), { ssr: false, }); @@ -33,7 +31,6 @@ const { Title, Paragraph } = Typography; const Emoji = () => { const [emojis, setEmojis] = useState([]); - const [loading, setLoading] = useState(false); const [submitStatus, setSubmitStatus] = useState(null); const [uploadFile, setUploadFile] = useState(null); @@ -133,30 +130,6 @@ const Emoji = () => { setLoading(false); } - const columns = [ - { - title: '', - key: 'delete', - render: (text, record) => ( - -