Align description buttons right. Switch to 12 hour format time
This commit is contained in:
parent
325619aa01
commit
7464d1e54f
|
@ -21,7 +21,7 @@ function ContractDescription(props: {
|
||||||
}) {
|
}) {
|
||||||
const { contract, isCreator } = props
|
const { contract, isCreator } = props
|
||||||
const [editing, setEditing] = useState(false)
|
const [editing, setEditing] = useState(false)
|
||||||
const editStatement = () => `${dayjs().format('MMM D, H:mma')}: `
|
const editStatement = () => `${dayjs().format('MMM D, h:mma')}: `
|
||||||
const [description, setDescription] = useState(editStatement())
|
const [description, setDescription] = useState(editStatement())
|
||||||
|
|
||||||
// Append the new description (after a newline)
|
// Append the new description (after a newline)
|
||||||
|
@ -42,7 +42,7 @@ function ContractDescription(props: {
|
||||||
(editing ? (
|
(editing ? (
|
||||||
<form className="mt-4">
|
<form className="mt-4">
|
||||||
<textarea
|
<textarea
|
||||||
className="textarea h-24 textarea-bordered w-full"
|
className="textarea h-24 textarea-bordered w-full mb-2"
|
||||||
value={description}
|
value={description}
|
||||||
onChange={(e) => setDescription(e.target.value || '')}
|
onChange={(e) => setDescription(e.target.value || '')}
|
||||||
autoFocus
|
autoFocus
|
||||||
|
@ -53,29 +53,31 @@ function ContractDescription(props: {
|
||||||
description.length
|
description.length
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
></textarea>
|
/>
|
||||||
<Row className="gap-2">
|
<Row className="gap-4 justify-end">
|
||||||
<button
|
|
||||||
className="btn btn-neutral btn-outline btn-sm mt-2"
|
|
||||||
onClick={saveDescription}
|
|
||||||
>
|
|
||||||
Save
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
className="btn btn-error btn-outline btn-sm mt-2"
|
className="btn btn-error btn-outline btn-sm mt-2"
|
||||||
onClick={() => setEditing(false)}
|
onClick={() => setEditing(false)}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
className="btn btn-neutral btn-outline btn-sm mt-2"
|
||||||
|
onClick={saveDescription}
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
</Row>
|
</Row>
|
||||||
</form>
|
</form>
|
||||||
) : (
|
) : (
|
||||||
|
<Row className="justify-end">
|
||||||
<button
|
<button
|
||||||
className="btn btn-neutral btn-outline btn-sm mt-4"
|
className="btn btn-neutral btn-outline btn-sm mt-4"
|
||||||
onClick={() => setEditing(true)}
|
onClick={() => setEditing(true)}
|
||||||
>
|
>
|
||||||
Add to description
|
Add to description
|
||||||
</button>
|
</button>
|
||||||
|
</Row>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user