Skip to content

Commit

Permalink
Merge pull request #12418 from TylerAPfledderer/refactor/remove-old-s…
Browse files Browse the repository at this point in the history
…elect

refactor: remove the old `Select` component
  • Loading branch information
pettinarip authored Mar 11, 2024
2 parents 9bd486f + 058ae6c commit 2ce32ca
Show file tree
Hide file tree
Showing 13 changed files with 131 additions and 331 deletions.
2 changes: 1 addition & 1 deletion src/@chakra-ui/components/ReactSelect.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createMultiStyleConfigHelpers, cssVar } from "@chakra-ui/react"

import { reactSelectAnatomyKeys } from "@/components/ReactSelect/innerComponents"
import { reactSelectAnatomyKeys } from "@/components/Select/innerComponents"

const $borderBaseWidth = cssVar("border-base-width")

Expand Down
78 changes: 0 additions & 78 deletions src/@chakra-ui/components/Select.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/@chakra-ui/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { Popover } from "./Popover"
import { Progress } from "./Progress"
import { Radio } from "./Radio"
import { ReactSelect } from "./ReactSelect"
import { Select } from "./Select"
import { Switch } from "./Switch"
import { Table } from "./Table"
import { Tabs } from "./Tabs"
Expand Down Expand Up @@ -54,7 +53,6 @@ export default {
Progress,
Radio,
ReactSelect,
Select,
Spinner: spinnerDefaultTheme,
Switch,
Table,
Expand Down
4 changes: 2 additions & 2 deletions src/components/CentralizedExchanges/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Emoji from "@/components/Emoji"
import InlineLink from "@/components/Link"
import OldHeading from "@/components/OldHeading"
import Text from "@/components/OldText"
import ReactSelect from "@/components/ReactSelect"
import Select from "@/components/Select"

import { getLocaleTimestamp } from "@/lib/utils/time"

Expand Down Expand Up @@ -103,7 +103,7 @@ const CentralizedExchanges = ({
{t("page-get-eth-exchanges-intro")}
</Text>
<Box w="full" maxW="container.sm">
<ReactSelect
<Select
instanceId="eth-exchange-region"
aria-label={t("page-get-eth-exchanges-header")}
options={selectOptions}
Expand Down
10 changes: 5 additions & 5 deletions src/components/FindWallet/WalletTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
import { Image } from "@/components/Image"
import InlineLink, { LinkProps } from "@/components/Link"
import Text from "@/components/OldText"
import ReactSelect, { ReactSelectOnChange } from "@/components/ReactSelect"
import Select, { SelectOnChange } from "@/components/Select"

import { trackCustomEvent } from "@/lib/utils/matomo"

Expand Down Expand Up @@ -246,7 +246,7 @@ const WalletTable = ({ filters, walletData }: WalletTableProps) => {
(
colName: ColumnClassName,
featureDispatch: SetFeatureSelectState
): ReactSelectOnChange<DropdownOption> =>
): SelectOnChange<DropdownOption> =>
(selectedOption) => {
if (!selectedOption) return
updateDropdown(selectedOption, featureDispatch, colName)
Expand Down Expand Up @@ -275,7 +275,7 @@ const WalletTable = ({ filters, walletData }: WalletTableProps) => {
<Text as="span" hideFrom="sm" fontSize="md" whiteSpace="nowrap">
{t("page-find-wallet-choose-features")}
</Text>
<ReactSelect
<Select
options={[
{
label: t("page-find-choose-to-compare"),
Expand All @@ -290,7 +290,7 @@ const WalletTable = ({ filters, walletData }: WalletTableProps) => {
/>
</Th>
<Th>
<ReactSelect
<Select
options={[
{
label: t("page-find-choose-to-compare"),
Expand All @@ -305,7 +305,7 @@ const WalletTable = ({ filters, walletData }: WalletTableProps) => {
/>
</Th>
<Th>
<ReactSelect
<Select
options={[
{
label: t("page-find-choose-to-compare"),
Expand Down
11 changes: 5 additions & 6 deletions src/components/Layer2/Layer2Onboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ import { ButtonLink } from "../Buttons"
import InlineLink from "../Link"
import OldHeading from "../OldHeading"
import Text from "../OldText"
import ReactSelect, { ReactSelectOnChange } from "../ReactSelect"
import { StyledSelect as Select } from "../SharedStyledComponents"
import Select, { SelectOnChange } from "../Select"

const Flex50 = (props: ChildOnlyProp) => (
<Box flex={{ base: "100%", md: "50%" }} {...props} />
Expand Down Expand Up @@ -174,7 +173,7 @@ const Layer2Onboard = ({
},
} as const

const handleLayer2SelectChange: ReactSelectOnChange<Layer2Option> = (
const handleLayer2SelectChange: SelectOnChange<Layer2Option> = (
selectedOption
) => {
if (!selectedOption) return
Expand All @@ -188,7 +187,7 @@ const Layer2Onboard = ({
setSelectedL2(selectedOption.l2)
}

const handleExchangeOnboard: ReactSelectOnChange<
const handleExchangeOnboard: SelectOnChange<
ExchangeOption | CexOnboardOption
> = (selectedOption) => {
if (!selectedOption) return
Expand Down Expand Up @@ -242,7 +241,7 @@ const Layer2Onboard = ({
</Box>
{/* LeftSelected */}
<Box mt="auto">
<ReactSelect
<Select
instanceId="layer2-left-selected"
placeholder={t("layer-2-onboard-wallet-input-placeholder")}
options={layer2Options}
Expand All @@ -265,7 +264,7 @@ const Layer2Onboard = ({
</Box>
{/* RightSelect */}
<Box mt="auto">
<ReactSelect
<Select
instanceId="exchange-onboard-select"
options={[
{
Expand Down
50 changes: 0 additions & 50 deletions src/components/ReactSelect/ReactSelect.stories.tsx

This file was deleted.

82 changes: 0 additions & 82 deletions src/components/ReactSelect/index.tsx

This file was deleted.

Loading

0 comments on commit 2ce32ca

Please sign in to comment.