mirror of
https://github.com/kac5a/k5_documents.git
synced 2026-07-28 08:42:45 -04:00
fix 0 when no citizen button, wrong logo on citizen document
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"files": {
|
||||
"main.js": "/web/build/static/js/main.71ac857d.js",
|
||||
"main.js": "/web/build/static/js/main.476ebdb5.js",
|
||||
"static/media/city_logo.png": "/web/build/static/media/city_logo.008b591a2d4e6445d96c.png",
|
||||
"index.html": "/web/build/index.html",
|
||||
"main.71ac857d.js.map": "/web/build/static/js/main.71ac857d.js.map"
|
||||
"main.476ebdb5.js.map": "/web/build/static/js/main.476ebdb5.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/js/main.71ac857d.js"
|
||||
"static/js/main.476ebdb5.js"
|
||||
]
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/><link href="https://fonts.googleapis.com/css2?family=Oooh+Baby&display=swap" rel="stylesheet"/><title>K5 Documents</title><script type="text/javascript" src="/web/build/config.js"></script><link rel="stylesheet" href="/web/build/customstyle.css"/><script defer="defer" src="/web/build/static/js/main.71ac857d.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/><link href="https://fonts.googleapis.com/css2?family=Oooh+Baby&display=swap" rel="stylesheet"/><title>K5 Documents</title><script type="text/javascript" src="/web/build/config.js"></script><link rel="stylesheet" href="/web/build/customstyle.css"/><script defer="defer" src="/web/build/static/js/main.476ebdb5.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
3
web/build/static/js/main.476ebdb5.js
Normal file
3
web/build/static/js/main.476ebdb5.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1,3 +1,10 @@
|
||||
/*!
|
||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
1
web/build/static/js/main.476ebdb5.js.map
Normal file
1
web/build/static/js/main.476ebdb5.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -7,7 +7,7 @@ import { useJob } from "../../hooks/useJob"
|
||||
type Props = {
|
||||
open: boolean
|
||||
handleClose: () => void
|
||||
handleTemplateClick: (template: DocumentTemplate) => void
|
||||
handleTemplateClick: (template: DocumentTemplate, citizen: boolean) => void
|
||||
citizen?: boolean
|
||||
}
|
||||
|
||||
@@ -35,12 +35,12 @@ const CreateDocumentModal = ({ open, handleClose, handleTemplateClick, citizen}:
|
||||
<DialogTitle>{texts.selectDocumentType}</DialogTitle>
|
||||
<List sx={{ pt: 0 }}>
|
||||
{citizen ? citizenTemplates.map((t) => (
|
||||
<ListItem onClick={() => handleTemplateClick(t)} key={t.id}>
|
||||
<ListItem onClick={() => handleTemplateClick(t, true)} key={t.id}>
|
||||
<ListItemText primary={t.documentName} />
|
||||
</ListItem>
|
||||
)) :
|
||||
(availableTempaltes && availableTempaltes.length) ? availableTempaltes.map((t) => (
|
||||
<ListItem onClick={() => handleTemplateClick(t)} key={t.id}>
|
||||
<ListItem onClick={() => handleTemplateClick(t, false)} key={t.id}>
|
||||
<ListItemText primary={t.documentName} />
|
||||
</ListItem>
|
||||
)) :
|
||||
|
||||
@@ -5,19 +5,20 @@ import DocumentTitle from "./DocumentTitle";
|
||||
import { usePlayerData } from "../../../hooks/usePlayerData";
|
||||
import moment from "moment"
|
||||
import { useJob } from "../../../hooks/useJob";
|
||||
import city_logo from "../../../assets/city_logo.png"
|
||||
import { useState } from "react";
|
||||
import SignButton from "./SignButton";
|
||||
import { DATE_FORMAT_SHORT } from "../../../utils/consts";
|
||||
import { availableJobs, texts } from "../../../AppConfig";
|
||||
import { texts } from "../../../AppConfig";
|
||||
import Editor from "../../Editor";
|
||||
|
||||
type Props = {
|
||||
template: DocumentTemplate
|
||||
handleCreate: (data: K5Document) => void
|
||||
handleClose: () => void
|
||||
logoSrc: string
|
||||
}
|
||||
|
||||
const CreateDocument = ({ template, handleCreate, handleClose }: Props) => {
|
||||
const CreateDocument = ({ template, handleCreate, handleClose, logoSrc }: Props) => {
|
||||
|
||||
const { playerData } = usePlayerData()
|
||||
const { job } = useJob()
|
||||
@@ -87,7 +88,7 @@ const CreateDocument = ({ template, handleCreate, handleClose }: Props) => {
|
||||
<Grid item container xs={12}>
|
||||
<Grid item xs={6}>
|
||||
<div style={{display: "flex", justifyContent: "center", alignItems: "center"}}>
|
||||
<img style={{height: "18.5vh"}} src={availableJobs.find(j => j.job === job?.name)?.logo ?? city_logo} alt="Los Santos City" />
|
||||
<img style={{height: "18.5vh"}} src={logoSrc} alt="Los Santos City" />
|
||||
</div>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
|
||||
@@ -7,6 +7,7 @@ import ViewIcon from '@mui/icons-material/RemoveRedEye';
|
||||
import ShowIcon from '@mui/icons-material/UploadFile';
|
||||
import CopyIcon from '@mui/icons-material/FileCopy';
|
||||
import DeleteDialog from "../Components/DeleteDialog"
|
||||
import city_logo from "../../assets/city_logo.png"
|
||||
import { Context } from "../../context/Context"
|
||||
import useDeleteDocument from "../../hooks/useDeleteDocument"
|
||||
import CreateDocumentModal from "../Components/CreateDocumentModal"
|
||||
@@ -14,14 +15,17 @@ import CreateDocument from "../Components/Forms/CreateDocument"
|
||||
import DocumentView from "../Components/DocumentView"
|
||||
import moment from "moment"
|
||||
import { DATE_FORMAT } from "../../utils/consts"
|
||||
import { citizenTemplates, texts } from "../../AppConfig"
|
||||
import { availableJobs, citizenTemplates, texts } from "../../AppConfig"
|
||||
import { useJob } from "../../hooks/useJob"
|
||||
|
||||
const IssuedDocuments = () => {
|
||||
|
||||
const [isDocumentFormOpen, setDocumentFormOpen] = useState(false)
|
||||
const [isTemplateListOpen, setTemplateListOpen] = useState(false)
|
||||
const [isCitizenListOpen, setCitizenListOpen] = useState(false)
|
||||
const [logoSrc, setLogoSrc] = useState(city_logo)
|
||||
const [documentTemplate, setDocumentTemplate] = useState<DocumentTemplate | undefined>()
|
||||
const { job } = useJob()
|
||||
|
||||
const {
|
||||
documents,
|
||||
@@ -110,8 +114,9 @@ const IssuedDocuments = () => {
|
||||
|
||||
}, [handleGetDocuments, setDocumentsLoading])
|
||||
|
||||
const handleTemplateSelect = (t: DocumentTemplate) => {
|
||||
const handleTemplateSelect = (t: DocumentTemplate, citizen: boolean) => {
|
||||
setTemplateListOpen(false)
|
||||
citizen ? setLogoSrc(city_logo) : setLogoSrc(availableJobs.find(j => j.job === job?.name)?.logo || city_logo)
|
||||
setDocumentTemplate(t)
|
||||
setDocumentFormOpen(true)
|
||||
}
|
||||
@@ -134,14 +139,14 @@ const IssuedDocuments = () => {
|
||||
/>
|
||||
</div>
|
||||
<div style={{ display: "flex", justifyContent: "flex-end" }}>
|
||||
{citizenTemplates.length && <Button variant="contained" style={{ marginRight: "8px" }} color="secondary" onClick={() => setCitizenListOpen(true)}>{texts.newCitizenDocumentBtn}</Button>}
|
||||
{!!citizenTemplates.length && <Button variant="contained" style={{ marginRight: "8px" }} color="secondary" onClick={() => setCitizenListOpen(true)}>{texts.newCitizenDocumentBtn}</Button>}
|
||||
<Button variant="contained" onClick={() => setTemplateListOpen(true)}>{texts.newDocumentBtn}</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Dialog maxWidth="md" open={isDocumentFormOpen} onClose={() => {
|
||||
setDocumentFormOpen(false)
|
||||
}}>
|
||||
<CreateDocument handleCreate={handleCreate} template={documentTemplate!} handleClose={() => {
|
||||
<CreateDocument handleCreate={handleCreate} logoSrc={logoSrc} template={documentTemplate!} handleClose={() => {
|
||||
setDocumentFormOpen(false)
|
||||
}} />
|
||||
</Dialog>
|
||||
|
||||
Reference in New Issue
Block a user