-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sponsors to announcements banners (#259)
* feat: add sponsors to Masthead * refactor: move Masthead to common folder * feat: add sponsors to Web3Auth banner * refactor: component for Masthead footer * refactor: move dup code to getImageSource * bump version
- Loading branch information
1 parent
59f6fdf
commit a94bfaa
Showing
13 changed files
with
226 additions
and
64 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
.container { | ||
text-align: center; | ||
background-color: var(--mui-palette-secondary-background); | ||
border-radius: 32px; | ||
padding: 24px 24px 80px; | ||
justify-content: space-between; | ||
margin-bottom: 40px; | ||
background-position: right; | ||
background-size: cover; | ||
position: relative; | ||
} | ||
|
||
.spot { | ||
position: absolute; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
bottom: 50px; | ||
width: 50%; | ||
height: 300px; | ||
background-image: radial-gradient(rgba(18, 255, 128, 0.8), rgba(18, 19, 18, 1) 100%); | ||
filter: blur(50px); | ||
} | ||
|
||
.text { | ||
margin-bottom: 16px; | ||
} | ||
|
||
.button { | ||
color: var(--mui-palette-secondary-main); | ||
} | ||
|
||
.chip { | ||
border-color: var(--mui-palette-text-primary); | ||
width: fit-content; | ||
} | ||
|
||
.linkButton { | ||
display: none; | ||
} | ||
|
||
.footer { | ||
position: absolute; | ||
bottom: 24px; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
display: flex; | ||
align-items: center; | ||
flex-direction: row; | ||
gap: 24px; | ||
width: max-content; | ||
} | ||
|
||
.tagline { | ||
color: var(--mui-palette-primary-light); | ||
text-transform: uppercase; | ||
} | ||
|
||
@media (min-width: 900px) { | ||
.container { | ||
padding: 90px 104px; | ||
border-bottom: 80px; | ||
text-align: left; | ||
} | ||
|
||
.spot { | ||
width: 300px; | ||
right: 10%; | ||
top: 50%; | ||
left: unset; | ||
transform: translateY(-50%); | ||
} | ||
|
||
.linkButton { | ||
display: block; | ||
} | ||
|
||
.image { | ||
display: flex; | ||
align-items: center; | ||
width: 300px; | ||
} | ||
|
||
.footer { | ||
left: unset; | ||
transform: unset; | ||
} | ||
} | ||
|
||
@media (min-width: 1440px) { | ||
.container { | ||
margin-left: -104px; | ||
margin-right: -104px; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { type ImageObj, getImageSource } from '@/lib/getImageSource' | ||
|
||
describe('getImageSource', () => { | ||
it('should return small image URL when image object exists and isSmall is true', () => { | ||
const imageObj: ImageObj = { | ||
sm: 'small-image.jpg', | ||
md: 'medium-image.jpg', | ||
alt: 'Small Image', | ||
} | ||
const isSmall = true | ||
|
||
const result = getImageSource(isSmall, imageObj) | ||
|
||
expect(result).toBe('small-image.jpg') | ||
}) | ||
|
||
it('should return medium image URL when image object exists and isSmall is false', () => { | ||
const imageObj: ImageObj = { | ||
sm: 'small-image.jpg', | ||
md: 'medium-image.jpg', | ||
alt: 'Medium Image', | ||
} | ||
const isSmall = false | ||
|
||
const result = getImageSource(isSmall, imageObj) | ||
|
||
expect(result).toBe('medium-image.jpg') | ||
}) | ||
|
||
it('should return undefined when image object does not exist', () => { | ||
const imageObj = undefined | ||
const isSmall = true | ||
|
||
const result = getImageSource(isSmall, imageObj) | ||
|
||
expect(result).toBeUndefined() | ||
}) | ||
}) |
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,15 @@ | ||
export type ImageObj = { | ||
sm: string | ||
md: string | ||
alt?: string | ||
} | ||
|
||
/** | ||
* Get the source URL for an image based on its size and screen condition. | ||
* @param {ImageObj} imageObj - The object containing URLs for different image sizes. | ||
* @param {boolean} isSmall - A flag indicating whether the small image shall be used. | ||
* @returns {string|undefined} - The source URL for the image, or undefined. | ||
*/ | ||
export function getImageSource(isSmall: boolean, imageObj?: ImageObj) { | ||
return imageObj ? (isSmall ? imageObj.sm : imageObj.md) : undefined | ||
} |