Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Mitra/Reusable hero banner #4135

Merged

Conversation

mitra-deriv
Copy link
Contributor

Changes:

Co-authored-by: @farzin-deriv

Type of change

  • Bug fix
  • New feature
  • Update feature
  • Refactor code
  • Translation to code
  • Translation to crowdin
  • Script configuration
  • Improve performance
  • Style only
  • Dependency update
  • Documentation update
  • Release

@vercel
Copy link

vercel bot commented Feb 3, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated
deriv-com βœ… Ready (Inspect) Visit Preview Feb 3, 2023 at 2:52PM (UTC)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2023

⚑️ Lighthouse report for the changes in this PR:

Category Score
πŸ”΄ Performance 42
🟒 Accessibility 96
🟠 Best practices 86
🟠 SEO 86
🟠 PWA 71

Lighthouse ran on https://deriv-com-git-fork-mitra-deriv-reusable-hero-banner.binary.sx/

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2023

Kudos, SonarCloud Quality Gate passed!Β  Β  Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@habib-deriv habib-deriv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@habib-deriv habib-deriv merged commit 9070b7d into binary-com:rebranding-deriv Feb 6, 2023
Copy link
Contributor

@farzin-deriv farzin-deriv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitra-deriv Just a suggestion, instead of derivez-logo.svg, It's better to have the icon and the text logo as separate files, So later in the code, if needed we can use them separately or put them together with the code, So we won’t need to add a new asset again in the future if we need the logo.

type TProps = {
color?: string
angle?: number
src?: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitra-deriv src is not used anywhere, It's only in the type, Maybe we can remove it? πŸ€”

color?: string
angle?: number
src?: string
children?: ReactNode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
children?: ReactNode

@mitra-deriv Instead use React.PropsWithChildren generic.

Comment on lines +17 to +18
`
const ShapeStyle = styled.div<Pick<TProps, 'angle'>>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`
const ShapeStyle = styled.div<Pick<TProps, 'angle'>>`
`
const ShapeStyle = styled.div<Pick<TProps, 'angle'>>`

Comment on lines +26 to +27
`
const BackgroundStyle = styled.div<Pick<TProps, 'color'>>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`
const BackgroundStyle = styled.div<Pick<TProps, 'color'>>`
`
const BackgroundStyle = styled.div<Pick<TProps, 'color'>>`

Just some spacing between variables for better readability πŸ™‡πŸ»

return (
<ContainerStyle>
<ShapeStyle angle={angle}>
<BackgroundStyle color={color}></BackgroundStyle>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<BackgroundStyle color={color}></BackgroundStyle>
<BackgroundStyle color={color} />

Comment on lines +40 to +41
`
const ContentWrapperStyle = styled.div`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`
const ContentWrapperStyle = styled.div`
`
const ContentWrapperStyle = styled.div`

Comment on lines +47 to +48
`
const HeroImageWrapper = styled.div`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`
const HeroImageWrapper = styled.div`
`
const HeroImageWrapper = styled.div`

}
`

const Hero = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const Hero = () => {
const Hero: React.FC = () => {

Comment on lines +70 to +71
const { is_mobile } = useBreakpoints()
return (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { is_mobile } = useBreakpoints()
return (
const { is_mobile } = useBreakpoints()
return (

<BackgroundStyle>
<ContentWrapperStyle>
<Content>
<img width="237px" height="64px" src={DerivEZLogo} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitra-deriv Maybe we can create a reusable component for platform logos since they will be used in many places, As I mentioned in the assets we can have the logo and text logo separately, and then in this component, you can put them together, and use it everywhere, Something like the following:

type TProps = {
  platform: 'deriv_ez' | 'deriv_go' | 'deriv_p2p' | ...
  visibility?: 'both' | 'icon' | 'text'
  size?: 'small' | 'medium' | 'large'
}

const PlatformLogo: React.FC<TProps> = ({ platform, visibility = 'both', size = 'medium' }) => ...


<PlatformLogo platform="deriv_ez" /> 
<PlatformLogo platform="deriv_p2p" visibility="icon" />
<PlatformLogo platform="deriv_go" visibility="text" size="large" />

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farzin-deriv Thanks for the time and Reviewing the PR , I will resolve them in another branch and mark the conversations as resolved once it is done πŸ™ 🌹

About the platforms logos just to be sure I got your point correctly, You mean we create a component which accepts the icon (the red one) + text (which here is deriv ez ) ?

Screenshot 2023-02-07 at 9 44 15 AM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not accepting icon and text as props, The component will handle it internally. Let's have a talk when you have time so I can explain it πŸ™‡πŸ»

@mitra-deriv mitra-deriv deleted the reusable-hero-banner branch February 8, 2023 02:56
@habib-deriv habib-deriv mentioned this pull request Mar 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants