update styles

This commit is contained in:
honzapatCZ 2024-01-23 00:50:18 +01:00
parent 5c33725869
commit 48188b5d0d
2 changed files with 10 additions and 9 deletions

View File

@ -2,7 +2,9 @@ import React from "react";
import tw, { styled } from "twin.macro"; import tw, { styled } from "twin.macro";
import "styled-components/macro"; import "styled-components/macro";
import { useField as useFormikField, useFormikContext } from "formik"; //import { useField as useFormikField, useFormikContext } from "formik";
const useFormikField = null;
const useFormikContext = ()=>{};
export function useField(props){ export function useField(props){
let getField = useFormikField; let getField = useFormikField;
@ -15,13 +17,13 @@ export function useField(props){
return getField(props); return getField(props);
} }
export default function Input({ label, title, className, children, ...props }) { export default function Input({ label, title, children, ...props }) {
/*name, id*/ /*name, id*/
const [field, meta, helpers] = useField(props); const [field, meta, helpers] = useField(props);
return ( return (
<div css={[title && tw`my-1`]} className={className}> <div css={[title && tw`my-1`]} >
{title && ( {title && (
<label <label
{...label} {...label}
@ -47,15 +49,14 @@ export default function Input({ label, title, className, children, ...props }) {
export function TextArea({ export function TextArea({
label, label,
title, title,
className, children,
children,
...props ...props
}) { }) {
const [field, meta, helpers] = useField(props); const [field, meta, helpers] = useField(props);
return ( return (
<div css={[title && tw`my-1`]} className={className}> <div css={[title && tw`my-1`]} >
{title && ( {title && (
<label <label
{...label} {...label}
@ -81,7 +82,7 @@ export function TextArea({
export function CheckBox({ export function CheckBox({
label, label,
title, title,
className,
children, children,
...props ...props
}) { }) {
@ -89,7 +90,7 @@ export function CheckBox({
const [field, meta, helpers] = useField(props); const [field, meta, helpers] = useField(props);
return ( return (
<div tw="my-1 flex text-secondary" className={className}> <div tw="my-1 flex text-secondary">
<input <input
{...props} {...props}
{...field} {...field}

View File

@ -68,7 +68,7 @@ body {
const GlobalStyles = () => { const GlobalStyles = () => {
return <> return <>
{/* <BaseStyles /> */} <BaseStyles />
<CustomStyles /> <CustomStyles />
</> </>
} }