diff --git a/.changeset/forty-zebras-kick.md b/.changeset/forty-zebras-kick.md new file mode 100644 index 0000000000..1562e57943 --- /dev/null +++ b/.changeset/forty-zebras-kick.md @@ -0,0 +1,5 @@ +--- +'@sovryn/ui': patch +--- + +SOV-786: remove react-router as UI dependency diff --git a/apps/frontend/package.json b/apps/frontend/package.json index d81cfbb87c..616e0deb56 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -14,6 +14,7 @@ "ethers": "5.7.1", "react": "18.2.0", "react-dom": "18.2.0", + "react-router-dom": "6.4.2", "react-scripts": "5.0.1" }, "devDependencies": { diff --git a/packages/ui/.storybook/preview.js b/packages/ui/.storybook/preview.js index 2121a9ae5b..fa48b43702 100644 --- a/packages/ui/.storybook/preview.js +++ b/packages/ui/.storybook/preview.js @@ -1,4 +1,3 @@ -import { MemoryRouter } from 'react-router-dom'; import resolveConfig from 'tailwindcss/resolveConfig'; import tailwindConfig from '@sovryn/tailwindcss-config/index'; @@ -12,14 +11,6 @@ const screens = { ...config.theme.screens, }; -export const decorators = [ - Story => ( - - - - ), -]; - const backgrounds = Object.entries(config.theme.backgroundColor).map( ([name, value]) => ({ name, value }), ); diff --git a/packages/ui/package.json b/packages/ui/package.json index 45dee4e1cb..74a2f515f3 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -57,8 +57,7 @@ "classnames": "2.3.1", "focus-trap-react": "10.0.0", "identity-obj-proxy": "3.0.0", - "jest-canvas-mock": "2.4.0", - "react-router-dom": "6.3.0" + "jest-canvas-mock": "2.4.0" }, "peerDependencies": { "react": ">=18.2", diff --git a/packages/ui/src/1_atoms/Button/Button.test.tsx b/packages/ui/src/1_atoms/Button/Button.test.tsx index 2e5e96f8fb..c1b49ac36d 100644 --- a/packages/ui/src/1_atoms/Button/Button.test.tsx +++ b/packages/ui/src/1_atoms/Button/Button.test.tsx @@ -3,8 +3,6 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; -import { MemoryRouter } from 'react-router-dom'; - import { Button } from './Button'; import { ButtonSize, ButtonStyle } from './Button.types'; @@ -39,28 +37,9 @@ describe('Button', () => { expect(document.activeElement).toEqual(ref.current); }); - it('can be focused when using refs (hyperlink / external)', () => { + it('can be focused when using refs (hyperlink)', () => { const ref = React.createRef(); - render( -