From d2f3ec880c492e3f3671ca2f6b268de12fdbe174 Mon Sep 17 00:00:00 2001 From: Nathan Richards Date: Wed, 14 Aug 2024 14:37:40 +0200 Subject: [PATCH] feat: changing height and present widget better for mobile (#276) Co-authored-by: Eugene Chybisov <18644653+chybisov@users.noreply.github.com> --- packages/widget-playground-vite/index.html | 2 +- .../src/components/Card/Card.style.tsx | 8 + .../DesignControls/ColorControls.tsx | 6 +- .../DesignControls/DesignControls.style.tsx | 50 +++- .../DesignControls/LayoutControls.tsx | 275 ++++++++++++++++++ .../BookmarkStoreControls.tsx | 79 +++++ .../DevViewToggleControl.tsx | 39 +++ .../HeaderAndFooterControls.tsx | 87 ++++++ .../PlaygroundSettingsControl.tsx | 24 ++ .../ViewportColorSelector.tsx} | 26 +- .../PlaygroundSettingsControl/index.ts | 1 + .../DesignControls/VariantControl.tsx | 41 ++- .../DrawerControls/DesignControls/index.ts | 1 + .../DrawerControls/DrawerControls.tsx | 2 + .../src/components/Mock/index.tsx | 11 + .../components/Widget/WidgetView.style.tsx | 52 +++- .../components/Widget/WidgetViewContainer.tsx | 56 +++- packages/widget-playground/src/hooks/index.ts | 1 + .../widget-playground/src/hooks/useDevView.ts | 30 ++ .../themeOverrides/body.ts | 10 + .../themeOverrides/dark.ts | 4 +- .../themeOverrides/light.ts | 5 +- .../src/store/editTools/EditToolsProvider.tsx | 16 +- .../store/editTools/createEditToolsStore.ts | 46 +++ .../src/store/editTools/index.ts | 2 + .../src/store/editTools/types.ts | 19 ++ .../store/editTools/useEditToolsActions.ts | 5 + .../editTools/useHeaderAndFooterToolValues.ts | 19 ++ .../src/store/editTools/useLayoutValues.ts | 13 + .../widgetConfig/createWidgetConfigStore.ts | 22 ++ .../src/store/widgetConfig/types.ts | 3 + .../store/widgetConfig/useConfigActions.ts | 2 + .../widgetConfig/utils/getConfigOutput.ts | 16 +- .../widget/src/components/AppContainer.tsx | 94 ++++-- .../src/components/Header/Header.style.ts | 39 ++- .../widget/src/components/Header/Header.tsx | 11 + .../components/Routes/RoutesExpanded.style.ts | 35 ++- .../src/components/Routes/RoutesExpanded.tsx | 17 +- .../src/components/TokenList/TokenList.tsx | 3 +- .../widget/src/components/TokenList/types.ts | 1 + packages/widget/src/config/constants.ts | 1 + packages/widget/src/hooks/useContentHeight.ts | 53 ---- .../widget/src/hooks/useSetContentHeight.ts | 24 ++ packages/widget/src/index.ts | 1 + .../pages/SelectTokenPage/SelectTokenPage.tsx | 36 +-- .../SelectTokenPage/useTokenListHeight.ts | 112 +++++++ .../src/pages/SendToWallet/BookmarksPage.tsx | 18 +- .../SendToWallet/SendToWalletPage.style.tsx | 30 +- .../pages/SendToWallet/SendToWalletPage.tsx | 75 ++--- .../TransactionDetailsPage.tsx | 1 - .../ExchangeRateBottomSheet.tsx | 2 +- .../TransactionPage/StatusBottomSheet.tsx | 2 +- .../TransactionPage/TokenValueBottomSheet.tsx | 2 +- packages/widget/src/themes/createTheme.ts | 1 + packages/widget/src/themes/types.ts | 2 + packages/widget/src/types/widget.ts | 2 + 56 files changed, 1322 insertions(+), 213 deletions(-) create mode 100644 packages/widget-playground/src/components/DrawerControls/DesignControls/LayoutControls.tsx create mode 100644 packages/widget-playground/src/components/DrawerControls/DesignControls/PlaygroundSettingsControl/BookmarkStoreControls.tsx create mode 100644 packages/widget-playground/src/components/DrawerControls/DesignControls/PlaygroundSettingsControl/DevViewToggleControl.tsx create mode 100644 packages/widget-playground/src/components/DrawerControls/DesignControls/PlaygroundSettingsControl/HeaderAndFooterControls.tsx create mode 100644 packages/widget-playground/src/components/DrawerControls/DesignControls/PlaygroundSettingsControl/PlaygroundSettingsControl.tsx rename packages/widget-playground/src/components/DrawerControls/DesignControls/{PlaygroundSettingsControl.tsx => PlaygroundSettingsControl/ViewportColorSelector.tsx} (60%) create mode 100644 packages/widget-playground/src/components/DrawerControls/DesignControls/PlaygroundSettingsControl/index.ts create mode 100644 packages/widget-playground/src/components/Mock/index.tsx create mode 100644 packages/widget-playground/src/hooks/useDevView.ts create mode 100644 packages/widget-playground/src/providers/PlaygroundThemeProvider/themeOverrides/body.ts create mode 100644 packages/widget-playground/src/store/editTools/useHeaderAndFooterToolValues.ts create mode 100644 packages/widget-playground/src/store/editTools/useLayoutValues.ts create mode 100644 packages/widget/src/config/constants.ts delete mode 100644 packages/widget/src/hooks/useContentHeight.ts create mode 100644 packages/widget/src/hooks/useSetContentHeight.ts create mode 100644 packages/widget/src/pages/SelectTokenPage/useTokenListHeight.ts diff --git a/packages/widget-playground-vite/index.html b/packages/widget-playground-vite/index.html index ff82c49c2..4733bd9a1 100644 --- a/packages/widget-playground-vite/index.html +++ b/packages/widget-playground-vite/index.html @@ -4,7 +4,7 @@ - +