mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
beter add button
This commit is contained in:
@@ -71,9 +71,34 @@ export function DayTitle({ day, dayAsDate }: { day: string; dayAsDate: Date }) {
|
|||||||
)}
|
)}
|
||||||
</ClientOnly>
|
</ClientOnly>
|
||||||
<Modal
|
<Modal
|
||||||
|
buttonComponent={({ openModal }) => (
|
||||||
|
<svg
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
width={22}
|
||||||
|
height={22}
|
||||||
|
className="cursor-pointer hover:scale-125 hover:stroke-slate-300 stroke-slate-400 transition-all m-0.5"
|
||||||
|
fill="none"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
onClick={openModal}
|
||||||
|
>
|
||||||
|
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
||||||
|
<g
|
||||||
|
id="SVGRepo_tracerCarrier"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
></g>
|
||||||
|
<g id="SVGRepo_iconCarrier">
|
||||||
|
<path
|
||||||
|
d="M6 12H18M12 6V18"
|
||||||
|
className=" "
|
||||||
|
stroke-width="3"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
modalControl={modal}
|
modalControl={modal}
|
||||||
buttonText="+"
|
|
||||||
buttonClass="unstyled hover:font-bold hover:scale-125 px-1 mb-auto mt-0 pt-0"
|
|
||||||
modalWidth="w-135"
|
modalWidth="w-135"
|
||||||
>
|
>
|
||||||
{({ closeModal }) => (
|
{({ closeModal }) => (
|
||||||
|
|||||||
@@ -25,22 +25,28 @@ export function useModal() {
|
|||||||
|
|
||||||
export default function Modal({
|
export default function Modal({
|
||||||
children,
|
children,
|
||||||
buttonText,
|
buttonText = "",
|
||||||
buttonClass = "",
|
buttonClass = "",
|
||||||
modalWidth = "w-1/3",
|
modalWidth = "w-1/3",
|
||||||
modalControl,
|
modalControl,
|
||||||
|
buttonComponent,
|
||||||
}: {
|
}: {
|
||||||
children: (props: { closeModal: () => void }) => ReactNode;
|
children: (props: { closeModal: () => void }) => ReactNode;
|
||||||
buttonText: string;
|
buttonText?: string;
|
||||||
buttonClass?: string;
|
buttonClass?: string;
|
||||||
modalWidth?: string;
|
modalWidth?: string;
|
||||||
modalControl: ModalControl;
|
modalControl: ModalControl;
|
||||||
|
buttonComponent?: (props: { openModal: () => void }) => ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{buttonComponent ? (
|
||||||
|
buttonComponent({ openModal: modalControl.openModal })
|
||||||
|
) : (
|
||||||
<button onClick={modalControl.openModal} className={buttonClass}>
|
<button onClick={modalControl.openModal} className={buttonClass}>
|
||||||
{buttonText}
|
{buttonText}
|
||||||
</button>
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={
|
className={
|
||||||
|
|||||||
@@ -7,33 +7,14 @@ export default function ExpandIcon({
|
|||||||
}) {
|
}) {
|
||||||
const size = "24px";
|
const size = "24px";
|
||||||
return (
|
return (
|
||||||
// <svg
|
|
||||||
// style={style}
|
|
||||||
|
|
||||||
// width={size}
|
|
||||||
// height={size}
|
|
||||||
// viewBox="0 0 17 17"
|
|
||||||
// version="1.1"
|
|
||||||
// className="si-glyph si-glyph-triangle-left transition-all ms-1 "
|
|
||||||
// >
|
|
||||||
// <g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
|
|
||||||
// <path
|
|
||||||
// d="M3.446,10.052 C2.866,9.471 2.866,8.53 3.446,7.948 L9.89,1.506 C10.471,0.924 11.993,0.667 11.993,2.506 L11.993,15.494 C11.993,17.395 10.472,17.076 9.89,16.495 L3.446,10.052 L3.446,10.052 Z"
|
|
||||||
// className="si-glyph-fill"
|
|
||||||
// style={{
|
|
||||||
// fill: "rgb(148 163 184 / var(--tw-text-opacity))",
|
|
||||||
// }}
|
|
||||||
// ></path>
|
|
||||||
// </g>
|
|
||||||
// </svg>
|
|
||||||
<svg
|
<svg
|
||||||
style={style}
|
style={style}
|
||||||
width={size}
|
width={size}
|
||||||
height={size}
|
height={size}
|
||||||
|
className="transition-all"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
fill="none"
|
fill="none"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
className="transition-all"
|
|
||||||
>
|
>
|
||||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
||||||
<g
|
<g
|
||||||
@@ -45,7 +26,6 @@ export default function ExpandIcon({
|
|||||||
<path
|
<path
|
||||||
className="stroke-slate-300"
|
className="stroke-slate-300"
|
||||||
d="M9 6L15 12L9 18"
|
d="M9 6L15 12L9 18"
|
||||||
// stroke="#FFFFFF"
|
|
||||||
stroke-width="2"
|
stroke-width="2"
|
||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
|
|||||||
Reference in New Issue
Block a user