Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iframe & configurator updates (widget-ui-9) #3255

Merged
merged 46 commits into from
Oct 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
2a1111d
feat: widget init mods
Sep 28, 2023
d6e6a76
feat: widget menu links
Sep 29, 2023
fc0113f
feat: select menu
Oct 3, 2023
6962653
feat: select menu
Oct 3, 2023
cd00476
feat: select menu
Oct 3, 2023
26de84c
Update apps/cowswap-frontend/src/modules/trade/containers/TradeWidget…
fairlighteth Oct 3, 2023
bac8ade
feat: fix semicolons
fairlighteth Oct 3, 2023
07ea891
feat: menu styling
fairlighteth Oct 3, 2023
3b76433
feat: general styling
fairlighteth Oct 9, 2023
a343871
feat: connect wallet internal
fairlighteth Oct 10, 2023
fe89695
feat: connect wallet internal
fairlighteth Oct 10, 2023
f931b09
feat: connect wallet internal
fairlighteth Oct 10, 2023
9180d5e
feat: widget configurator app
fairlighteth Oct 10, 2023
d96c8c7
feat: widget configurator app
fairlighteth Oct 11, 2023
c23d531
feat: widget configurator app
fairlighteth Oct 12, 2023
30565eb
feat: widget configurator app
fairlighteth Oct 12, 2023
64c8533
feat: widget configurator app
fairlighteth Oct 12, 2023
d0b064e
feat: widget configurator app
fairlighteth Oct 12, 2023
6c39e14
feat: widget configurator app
fairlighteth Oct 12, 2023
8638950
feat: widget configurator app
fairlighteth Oct 12, 2023
790abd0
feat: widget configurator app
fairlighteth Oct 13, 2023
65c6f00
feat: widget configurator app
fairlighteth Oct 16, 2023
527108a
Merge branch 'develop' into widget-ui-6
fairlighteth Oct 16, 2023
a133ca5
feat: widget configurator app
fairlighteth Oct 16, 2023
0abd19e
refactor: extract AccountElement and AccountModalState
shoom3301 Oct 18, 2023
964aaa2
feat: update theme
fairlighteth Oct 18, 2023
9374bf8
feat: update modalheader
fairlighteth Oct 18, 2023
7e8aa60
feat: update modalheader
fairlighteth Oct 18, 2023
4047b4b
Merge branch 'widget-ui-6' into widget-ui-7
fairlighteth Oct 18, 2023
e47fcb6
feat: update modalheader
fairlighteth Oct 18, 2023
3833a91
feat: refactor code
fairlighteth Oct 19, 2023
6e1716c
feat: iframe resizer
fairlighteth Oct 19, 2023
95cb964
feat: powered by footer
fairlighteth Oct 19, 2023
cdc5f5a
feat: iframe WIP
fairlighteth Oct 19, 2023
aa56228
feat: revert tsconfig
fairlighteth Oct 20, 2023
146b508
feat: merge develop
fairlighteth Oct 20, 2023
dc1f1de
feat: fix import
fairlighteth Oct 20, 2023
bcf3e7a
feat: fix gap loading spinner
fairlighteth Oct 20, 2023
38615c6
feat: cleanup + optimize iframeresizer
fairlighteth Oct 20, 2023
be7c010
feat: add ENUM
fairlighteth Oct 20, 2023
dd900b3
feat: optimize iframeResizer script
fairlighteth Oct 20, 2023
840dda5
feat: fix height iframe
fairlighteth Oct 20, 2023
c3dcb7b
feat: configurator background
fairlighteth Oct 20, 2023
a50a5a4
feat: fix fav tokens styles
fairlighteth Oct 23, 2023
ec44b5a
Merge branch 'develop' into widget-ui-9
fairlighteth Oct 23, 2023
002c17f
feat: fix img alt
fairlighteth Oct 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: merge develop
  • Loading branch information
fairlighteth committed Oct 20, 2023
commit 146b5088e6fd9d0466edc4ceac181156a876f8b9
4 changes: 1 addition & 3 deletions apps/cowswap-frontend/src/legacy/theme/index.tsx
Original file line number Diff line number Diff line change
@@ -174,9 +174,7 @@ export default function ThemeProvider({ children }: { children?: React.ReactNode
const darkMode = useIsDarkMode()
const isInjectedWidgetMode = isInjectedWidget()

const themeObject = useMemo(() => {
return theme(darkMode, isInjectedWidgetMode);
}, [darkMode, isInjectedWidgetMode]);
const themeObject = useMemo(() => theme(darkMode, isInjectedWidgetMode), [darkMode, isInjectedWidgetMode])

return <StyledComponentsThemeProvider theme={themeObject}>{children}</StyledComponentsThemeProvider>
}
Original file line number Diff line number Diff line change
@@ -37,10 +37,10 @@ export const BodyWrapper = styled.div`
justify-content: center;
flex: 1 1 auto;
z-index: 2;
padding: ${({ theme }) => theme.isInjectedWidgetMode ? '16px 16px 0' : '5vh 16px 0'};
padding: ${({ theme }) => (theme.isInjectedWidgetMode ? '16px 16px 0' : '5vh 16px 0')};

${({ theme }) => theme.mediaWidth.upToMedium`
padding: ${({ theme }) => theme.isInjectedWidgetMode ? '0 0 16px' : '0 10px 16px'};
padding: ${({ theme }) => (theme.isInjectedWidgetMode ? '0 0 16px' : '0 10px 16px')};
flex: none;
`}
`
Original file line number Diff line number Diff line change
@@ -82,28 +82,32 @@ export function TradeWidgetLinks({
)
})

const singleMenuItem = menuItems.length === 1;
const singleMenuItem = menuItems.length === 1

return isDropdown ? (
<>
<styledEl.MenuItem onClick={() => !singleMenuItem && setDropdownVisible(!isDropdownVisible)} isDropdownVisible={isDropdownVisible}>
<styledEl.MenuItem
onClick={() => !singleMenuItem && setDropdownVisible(!isDropdownVisible)}
isDropdownVisible={isDropdownVisible}
>
<styledEl.Link to={menuItems.find((item) => item.props.isActive)?.props.routePath || '#'}>
<Trans>
{menuItems.find((item) => item.props.isActive)?.props.item.label}
{!singleMenuItem ? <SVG src={IMAGE_CARRET} title="select" /> : null}
</Trans>
</styledEl.Link>
</styledEl.MenuItem>

{isDropdownVisible && <styledEl.SelectMenu>
{isDropdownVisible && <ModalHeader onBack={handleMenuItemClick}>Trading mode</ModalHeader>}
{menuItems}

{isDropdownVisible && (
<styledEl.SelectMenu>
<ModalHeader onBack={handleMenuItemClick}>Trading mode</ModalHeader>
{menuItems}
</styledEl.SelectMenu>
}
)}
</>
) : (
<styledEl.Wrapper>{menuItems}</styledEl.Wrapper>
);
)
}

const MenuItem = ({
4 changes: 1 addition & 3 deletions apps/cowswap-frontend/src/test-utils.tsx
Original file line number Diff line number Diff line change
@@ -30,9 +30,7 @@ const MockThemeProvider = ({ children }: { children: React.ReactNode }) => {
const darkMode = useIsDarkMode()
const isInjectedWidgetMode = isInjectedWidget()

const themeObject = useMemo(() => {
return theme(darkMode, isInjectedWidgetMode);
}, [darkMode, isInjectedWidgetMode]);
const themeObject = useMemo(() => theme(darkMode, isInjectedWidgetMode), [darkMode, isInjectedWidgetMode])

return <StyledComponentsThemeProvider theme={themeObject}>{children}</StyledComponentsThemeProvider>
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,9 @@
"scripts": {
"start": "nx run cowswap-frontend:serve",
"start-widget": "nx run widget-configurator:serve",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=32768 nx build cowswap-frontend",
"ipfs:build": "PUBLIC_URL=\".\" yarn build",
"ipfs:publish": "npx ipfs-deploy build -p pinata -O",
"preview": "cross-env NODE_OPTIONS=--max-old-space-size=32768 nx run cowswap-frontend:preview",
"cosmos:export": "cross-env NODE_OPTIONS=--max-old-space-size=32768 nx run cowswap-frontend:cosmos:export",
"cosmos": "nx run cowswap-frontend:cosmos:run",
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -19142,11 +19142,6 @@ postcss@^8.4.27:
picocolors "^1.0.0"
source-map-js "^1.0.2"

[email protected]:
version "10.4.1"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.4.1.tgz#9b3ba020547673a231c6cf16f0fbaef0e8863431"
integrity sha512-WKrRpCSwL2t3tpOOGhf2WfTpcmbpxaWtDbdJdKdjd0aEiTkvOmS4NBkG6kzlaAHI9AkQ3iVqbFWM3Ei7mZ4o1Q==

preact@^10.5.9:
version "10.16.0"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.16.0.tgz#68a06d70b191b8a313ea722d61e09c6b2a79a37e"
You are viewing a condensed version of this merge commit. You can view the full changes here.