Skip to content

Commit

Permalink
refactor: use new lib/button (#4021)
Browse files Browse the repository at this point in the history
* fix: header widgets height

* stash old primary button

* fix: header widgets height

* danger button

* delete danger button

* stash old ghost button

* vote button

* delete color button

* clean

* ghost button

* primary button

* fix calendar create button

* fix: calendar event button

* fix calendar

* old button icon

* isLoading

* isFill

* delete primary button
  • Loading branch information
2nthony authored Mar 18, 2024
1 parent f9d9532 commit 4283f91
Show file tree
Hide file tree
Showing 75 changed files with 218 additions and 467 deletions.
4 changes: 2 additions & 2 deletions packages/kintsugi-next/components/referenda/vote.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "utils/referendumUtil";
import Threshold from "./threshold";
import Loading from "next-common/components/loading";
import PrimaryButton from "next-common/components/buttons/primaryButton";
import PrimaryButton from "next-common/lib/button/primary";
import { SecondaryCardDetail } from "next-common/components/styled/containers/secondaryCard";
import { TitleContainer } from "next-common/components/styled/containers/titleContainer";
import { useSelector } from "react-redux";
Expand Down Expand Up @@ -217,7 +217,7 @@ function Vote({ referendumInfo, referendumIndex }) {

{!referendumInfo?.finished && (
<PrimaryButton
isFill
className="w-full"
onClick={() => {
setShowVote(true);
}}
Expand Down
47 changes: 0 additions & 47 deletions packages/next-common/components/buttons/colorButton.js

This file was deleted.

40 changes: 0 additions & 40 deletions packages/next-common/components/buttons/dangerButton.js

This file was deleted.

40 changes: 0 additions & 40 deletions packages/next-common/components/buttons/ghostButton.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/next-common/components/buttons/index.js

This file was deleted.

10 changes: 0 additions & 10 deletions packages/next-common/components/buttons/loading.js

This file was deleted.

10 changes: 0 additions & 10 deletions packages/next-common/components/buttons/loadingV2.js

This file was deleted.

39 changes: 0 additions & 39 deletions packages/next-common/components/buttons/primaryButton.js

This file was deleted.

79 changes: 0 additions & 79 deletions packages/next-common/components/buttons/styled.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PopupWithSigner from "../../../components/popupWithSigner";
import Title from "./title";
import Link from "./link";
import Description from "./description";
import PrimaryButton from "next-common/components/buttons/primaryButton";
import PrimaryButton from "next-common/lib/button/primary";
import nextApi from "../../../services/nextApi";
import { useDispatch } from "react-redux";
import {
Expand Down Expand Up @@ -136,7 +136,7 @@ function PopupContent() {
/>
<Link setValue={setLink} />
<PopupButtonWrapper>
<PrimaryButton isLoading={isLoading} onClick={submit}>
<PrimaryButton loading={isLoading} onClick={submit}>
Submit
</PrimaryButton>
</PopupButtonWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useCallback, useState } from "react";
import dayjs from "dayjs";
import timezone from "dayjs/plugin/timezone";
import Popup from "../../../components/popup/wrapper/Popup";
import PrimaryButton from "next-common/components/buttons/primaryButton";
import PrimaryButton from "next-common/lib/button/primary";
import { noop } from "lodash-es";
import Day from "./day";
import Time from "./time";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "../../../../../store/reducers/toastSlice";
import { calendarUserEventsApi } from "../../../../../services/url";
import ErrorMessage from "../../../../styled/errorMessage";
import DangerButton from "../../../../buttons/dangerButton";
import DangerButton from "next-common/lib/button/danger";
import { noop } from "lodash-es";
import { PopupButtonWrapper } from "../../../../popup/wrapper";
import { useEnsureLogin } from "next-common/hooks/useEnsureLogin";
Expand Down Expand Up @@ -52,7 +52,7 @@ export default function DeleteEventModal({ event, onClose, refresh = noop }) {
Are you sure you would like to delete this user event from the calendar?
</ErrorMessage>
<PopupButtonWrapper>
<DangerButton onClick={deleteEvent} isLoading={isLoading}>
<DangerButton onClick={deleteEvent} loading={isLoading}>
Delete
</DangerButton>
</PopupButtonWrapper>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
import React from "react";
import { noop } from "lodash-es";
import PrimaryButton from "next-common/components/buttons/primaryButton";
import PrimaryButton from "next-common/lib/button/primary";
import Tooltip from "next-common/components/tooltip";
import { SystemPlus } from "@osn/icons/subsquare";

export default function CreateEventButton({ disabled, onClick = noop }) {
return (
<Tooltip content={disabled ? "Only admins can create events" : ""}>
<PrimaryButton
small
size="small"
className="w-7 p-0 sm:hidden"
disabled={disabled}
onClick={onClick}
icon={
<SystemPlus className="[&_path]:fill-textPrimaryContrast w-4 h-4" />
}
>
<span className="max-sm:hidden">Create Event</span>
<SystemPlus className="w-4 h-4" />
</PrimaryButton>

<PrimaryButton
size="small"
className="max-sm:hidden"
disabled={disabled}
onClick={onClick}
iconLeft={<SystemPlus className="w-4 h-4" />}
>
Create Event
</PrimaryButton>
</Tooltip>
);
Expand Down
Loading

0 comments on commit 4283f91

Please sign in to comment.