-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e1716c
commit 95cb964
Showing
7 changed files
with
72 additions
and
21 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions
47
apps/cowswap-frontend/src/common/pure/PoweredFooter/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { COW_PROTOCOL_LINK } from '@cowprotocol/common-const' | ||
import { ExternalLink } from '@cowprotocol/ui' | ||
|
||
import { Trans } from '@lingui/macro' | ||
import cowIcon from 'assets/logo/cow-icon.svg' | ||
import SVG from 'react-inlinesvg' | ||
import styled from 'styled-components/macro' | ||
|
||
import { UI } from 'common/constants/theme' | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
flex-flow: row wrap; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: var(${UI.FONT_SIZE_SMALLER}); | ||
padding: 4px 0; | ||
` | ||
|
||
const StyledExternalLink = styled(ExternalLink)` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 4px; | ||
color: var(${UI.COLOR_TEXT2}); | ||
> svg { | ||
--size: 14px; | ||
width: var(--size); | ||
height: var(--size); | ||
} | ||
> svg > g > path { | ||
fill: var(${UI.COLOR_TEXT2}); | ||
} | ||
` | ||
|
||
export function PoweredFooter() { | ||
return ( | ||
<Wrapper> | ||
<StyledExternalLink href={COW_PROTOCOL_LINK}> | ||
<SVG src={cowIcon} title="CoW Protocol" /> | ||
<Trans>Powered by CoW Protocol</Trans> | ||
</StyledExternalLink> | ||
</Wrapper> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,27 @@ | ||
import { useEffect } from 'react'; | ||
import { useEffect } from 'react' | ||
|
||
export function IframeResizer() { | ||
useEffect(() => { | ||
// Initial height calculation and message | ||
const sendHeightUpdate = () => { | ||
const contentHeight = document.body.scrollHeight; | ||
window.parent.postMessage({ type: 'iframeHeight', height: contentHeight }, '*'); | ||
}; | ||
sendHeightUpdate(); | ||
const contentHeight = document.body.scrollHeight | ||
window.parent.postMessage({ type: 'iframeHeight', height: contentHeight }, '*') | ||
} | ||
sendHeightUpdate() | ||
|
||
// Set up a MutationObserver to watch for changes in the DOM | ||
const observer = new MutationObserver(() => { | ||
// For simplicity, we'll send an update for any mutation, but you can add more specific checks if needed | ||
sendHeightUpdate(); | ||
}); | ||
sendHeightUpdate() | ||
}) | ||
|
||
// Start observing the entire body and its descendants for changes to the structure of the DOM | ||
observer.observe(document.body, { attributes: true, childList: true, subtree: true }); | ||
observer.observe(document.body, { attributes: true, childList: true, subtree: true }) | ||
|
||
// Cleanup: Disconnect the observer when the component is unmounted | ||
return () => { | ||
observer.disconnect(); | ||
}; | ||
observer.disconnect() | ||
} | ||
}, []) | ||
|
||
}, []); | ||
|
||
return null; | ||
} | ||
return null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters