Skip to content

Commit

Permalink
fix: address various design QA for buttons (#4118)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Jun 11, 2024
1 parent fa2f6c4 commit 0d5f01b
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const DetailUnitDrawer = ({ unit, setUnitDrawer }: UnitDrawerProps) => {
</Card.Section>
</Card>

<Button variant="primary" onClick={() => setUnitDrawer(null)}>
<Button variant="primary" size="sm" onClick={() => setUnitDrawer(null)}>
{t("t.done")}
</Button>
</Drawer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const DetailApplicationDates = () => {
<Button
type="button"
variant="text"
size="sm"
className="font-semibold"
onClick={() => setDrawer(event)}
>
Expand Down Expand Up @@ -125,7 +126,7 @@ const DetailApplicationDates = () => {
</Card.Section>
</Card>

<Button variant="primary" onClick={() => setDrawer(null)}>
<Button variant="primary" size="sm" onClick={() => setDrawer(null)}>
{t("t.done")}
</Button>
</Drawer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const DetailUnits = ({ setUnitDrawer }: DetailUnitsProps) => {
<Button
type="button"
variant="text"
size="sm"
className="font-semibold"
onClick={() => setUnitDrawer(unit)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,13 @@ const OpenHouseForm = ({ onSubmit, currentEvent }: OpenHouseFormProps) => {
</Card.Section>
</Card>

<Button type="button" onClick={() => handleSubmit()} variant="primary" className="mr-4 mt-5">
<Button
type="button"
onClick={() => handleSubmit()}
variant="primary"
size="sm"
className="mr-4 mt-5"
>
{t("t.save")}
</Button>
</Form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ const ListingForm = ({ listing, editMode }: ListingFormProps) => {

<Form id="listing-form">
<div className="flex flex-row flex-wrap">
<div className="md:w-9/12 pb-24">
<div className="md:w-9/12 pb-28">
<Tabs
forceRenderTabPanel={true}
selectedIndex={tabIndex}
Expand Down Expand Up @@ -410,7 +410,7 @@ const ListingForm = ({ listing, editMode }: ListingFormProps) => {
)}
</div>

<aside className="md:w-3/12 md:pl-6">
<aside className="w-full md:w-3/12 md:pl-6">
<ListingFormActions
type={editMode ? ListingFormActionsType.edit : ListingFormActionsType.add}
showCloseListingModal={() => setCloseModal(true)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const ApplicationDates = ({
<div className="flex gap-3">
<Button
type="button"
size="sm"
className="font-semibold"
onClick={() => setDrawerOpenHouse(event)}
variant="text"
Expand All @@ -52,6 +53,7 @@ const ApplicationDates = ({
</Button>
<Button
type="button"
size="sm"
className="font-semibold text-alert"
onClick={() => setModalDeleteOpenHouse(event)}
variant="text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const ApplicationTypes = ({ listing }: { listing: FormListing }) => {
content: (
<Button
type="button"
size="sm"
className="font-semibold text-alert"
onClick={() => {
setCloudinaryData({
Expand Down Expand Up @@ -391,6 +392,7 @@ const ApplicationTypes = ({ listing }: { listing: FormListing }) => {
<div className="flex">
<Button
type="button"
size="sm"
className="font-semibold text-alert"
onClick={() => {
const items = methods.paper.paperApplications.filter(
Expand Down Expand Up @@ -418,6 +420,7 @@ const ApplicationTypes = ({ listing }: { listing: FormListing }) => {
<Button
type="button"
variant="primary-outlined"
size="sm"
onClick={() => {
// default the application to English:
setSelectedLanguage(LanguagesEnum.en)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const BuildingSelectionCriteria = () => {
setProgressValue(0)
}}
variant="text"
size="sm"
>
{t("t.delete")}
</Button>
Expand Down Expand Up @@ -129,6 +130,7 @@ const BuildingSelectionCriteria = () => {
setDrawerState(true)
}}
variant="text"
size="sm"
>
{t("t.edit")}
</Button>
Expand All @@ -140,6 +142,7 @@ const BuildingSelectionCriteria = () => {
deletePDF()
}}
variant="text"
size="sm"
>
{t("t.delete")}
</Button>
Expand All @@ -164,6 +167,7 @@ const BuildingSelectionCriteria = () => {
setDrawerState(true)
}}
variant="text"
size="sm"
>
{t("t.edit")}
</Button>
Expand All @@ -174,6 +178,7 @@ const BuildingSelectionCriteria = () => {
setValue("buildingSelectionCriteria", "")
}}
variant="text"
size="sm"
>
{t("t.delete")}
</Button>
Expand Down Expand Up @@ -213,6 +218,7 @@ const BuildingSelectionCriteria = () => {
id="addBuildingSelectionCriteriaButton"
type="button"
variant="primary-outlined"
size="sm"
onClick={() => {
setDrawerState(true)
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const ListingPhotos = () => {
saveImageFields(fields.filter((item, i2) => i2 != index) as ListingImage[])
}}
variant="text"
size="sm"
>
{t("t.delete")}
</Button>
Expand Down Expand Up @@ -139,6 +140,7 @@ const ListingPhotos = () => {
<Button
variant="text"
className="ml-0"
size="sm"
onClick={() => {
const resortedImages = [
drawerImages[index],
Expand Down Expand Up @@ -167,6 +169,7 @@ const ListingPhotos = () => {
setDrawerImages(filteredImages)
}}
variant="text"
size="sm"
>
{t("t.delete")}
</Button>
Expand Down Expand Up @@ -222,6 +225,7 @@ const ListingPhotos = () => {
<Button
type="button"
variant={fieldHasError(errors?.listingImages) ? "alert" : "primary-outlined"}
size="sm"
onClick={() => {
setDrawerState(true)
setDrawerImages([...listingFormPhotos])
Expand Down Expand Up @@ -288,6 +292,7 @@ const ListingPhotos = () => {
<Button
variant="primary"
type="button"
size="sm"
className={"mt-4"}
onClick={() => {
saveImageFields(drawerImages)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const LotteryResults = (props: LotteryResultsProps) => {
setProgressValue(0)
}}
variant="text"
size="sm"
>
{t("t.delete")}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const SelectAndOrder = ({
deleteItem(item, false)
}}
variant="text"
size="sm"
>
{t("t.delete")}
</Button>
Expand Down Expand Up @@ -137,6 +138,7 @@ const SelectAndOrder = ({
deleteItem(item, true)
}}
variant="text"
size="sm"
>
{t("t.delete")}
</Button>
Expand Down Expand Up @@ -279,6 +281,7 @@ const SelectAndOrder = ({
id={`add-${applicationSection}-button`}
type="button"
variant="primary-outlined"
size="sm"
onClick={() => setTableDrawer(true)}
>
{listingData.length ? editText : addText}
Expand Down Expand Up @@ -312,6 +315,7 @@ const SelectAndOrder = ({
<Button
type="button"
variant="primary-outlined"
size="sm"
onClick={() => {
setSelectDrawer(true)
}}
Expand Down Expand Up @@ -380,6 +384,7 @@ const SelectAndOrder = ({
type="button"
className={"mt-4"}
variant="primary"
size="sm"
onClick={() => {
const formData = getValues()
const formItems = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const FormUnits = ({ units, setUnits, disableUnitsAccordion }: UnitProps) => {
className="font-semibold"
onClick={() => editUnit(unit.tempId)}
variant="text"
size="sm"
>
{t("t.edit")}
</Button>
Expand All @@ -126,6 +127,7 @@ const FormUnits = ({ units, setUnits, disableUnitsAccordion }: UnitProps) => {
className="font-semibold text-alert"
onClick={() => setUnitDeleteModal(unit.tempId)}
variant="text"
size="sm"
>
{t("t.delete")}
</Button>
Expand Down Expand Up @@ -207,6 +209,7 @@ const FormUnits = ({ units, setUnits, disableUnitsAccordion }: UnitProps) => {
id="addUnitsButton"
type="button"
variant={fieldHasError(errors?.units) ? "alert" : "primary-outlined"}
size="sm"
onClick={() => {
editUnit(units.length + 1)
clearErrors("units")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ const PreferenceDrawer = ({
type="button"
size="sm"
className="w-max"
variant={errors["questions"] ? "alert" : "primary"}
variant={errors["questions"] ? "alert-outlined" : "primary-outlined"}
onClick={() => {
clearErrors("questions")
setOptionData(null)
Expand Down

0 comments on commit 0d5f01b

Please sign in to comment.