-
-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
d06bbcf
commit 29a20a9
Showing
6 changed files
with
77 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Fab, { FabProps } from '@mui/material/Fab' | ||
import { forwardRef } from 'react' | ||
|
||
interface MediaButtonProps extends Partial<FabProps> { | ||
isActive: boolean | ||
} | ||
|
||
export const MediaButton = forwardRef<HTMLButtonElement, MediaButtonProps>( | ||
({ isActive, ...props }: MediaButtonProps, ref) => { | ||
return ( | ||
<Fab | ||
{...props} | ||
ref={ref} | ||
sx={theme => | ||
theme.palette.mode === 'dark' | ||
? isActive | ||
? { | ||
color: theme.palette.common.white, | ||
background: theme.palette.success.main, | ||
'&:hover': { | ||
background: theme.palette.success.dark, | ||
}, | ||
} | ||
: { | ||
background: theme.palette.grey[500], | ||
'&:hover': { | ||
background: theme.palette.grey[600], | ||
}, | ||
} | ||
: isActive | ||
? { | ||
color: theme.palette.common.white, | ||
background: theme.palette.success.main, | ||
'&:hover': { | ||
background: theme.palette.success.dark, | ||
}, | ||
} | ||
: { | ||
color: theme.palette.common.black, | ||
background: theme.palette.grey[400], | ||
'&:hover': { | ||
background: theme.palette.grey[500], | ||
}, | ||
} | ||
} | ||
/> | ||
) | ||
} | ||
) |
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
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
29a20a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
chitchatter – ./
chitchatter-git-main-jeremyckahn.vercel.app
chitchatter.vercel.app
chitchatter-jeremyckahn.vercel.app