Skip to content

Commit

Permalink
fix(theme): background and width
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmethalis committed Oct 23, 2023
1 parent 9ea7336 commit 5fa6c00
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/nasty-pillows-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'rc-credit-card': patch
---

fix(theme): update custom width and background
6 changes: 4 additions & 2 deletions src/components/CreditCard/CreditCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import './flip-transation.css'

import { CSSTransition } from 'react-transition-group'
import styled, { createGlobalStyle, ThemeProvider } from 'styled-components'

Expand All @@ -21,6 +19,8 @@ const Card = styled.div`
height: 100%;
width: 100%;
padding: 25px;
width: ${({ theme }) => theme.width}px;
height: ${({ theme }) => theme.height}px;
border-radius: ${({ theme }) => theme.borderRadius}px;
backdrop-filter: blur(${({ theme }) => theme.backdropBlur}px);
${({ theme }) =>
Expand Down Expand Up @@ -146,6 +146,8 @@ const Signature = styled.span`
`

export type CreditCardTheme = {
width?: number
height?: number
borderRadius?: number
background?: [number, number, number, number] | string
backdropBlur?: number
Expand Down
2 changes: 2 additions & 0 deletions src/components/CreditCard/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import './style.css'

export type { CreditCardProps } from './CreditCard'
export { CreditCard } from './CreditCard'
File renamed without changes.
6 changes: 4 additions & 2 deletions src/components/CreditCard/useCustomTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import { CreditCardTheme } from './CreditCard'
export const useCustomTheme = (theme?: CreditCardTheme) => {
const customTheme = useMemo(() => {
return {
width: 400,
height: 220,
borderRadius: 15,
background: [255, 255, 255, 0.1],
background: [18, 19, 33, 0.1],
backdropBlur: 25,
shadow: true,
border: true,
borderWidth: 1,
borderStyle: 'solid',
borderColor: [255, 255, 255, 0.1],
borderColor: [18, 19, 33, 0.1],
color: '#fff',
...theme,
}
Expand Down

0 comments on commit 5fa6c00

Please sign in to comment.