-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Video player (fixes from feat/video-player branch)
- Loading branch information
Showing
20 changed files
with
1,026 additions
and
1,564 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,77 @@ | ||
import React from "react"; | ||
import { View, StyleSheet } from "react-native"; | ||
import { View, ViewStyle, TextStyle } from "react-native"; | ||
|
||
import { HoverView } from "./HoverView"; | ||
import Link from "../../../assets/player/link.svg"; | ||
import { neutralA3, neutral33, secondaryColor } from "../../utils/style/colors"; | ||
import { neutralA3, neutral33 } from "../../utils/style/colors"; | ||
import { fontSemibold13 } from "../../utils/style/fonts"; | ||
import { layout } from "../../utils/style/layout"; | ||
import { BrandText } from "../BrandText"; | ||
import { SVG } from "../SVG"; | ||
import { SpacerRow } from "../spacer"; | ||
|
||
interface DetailAlbumMenuProps { | ||
id: string; | ||
} | ||
|
||
const buttonHeight = 36; | ||
export const DetailAlbumMenu: React.FC<DetailAlbumMenuProps> = ({ id }) => { | ||
const shareMenuWidth = 188; | ||
const lineHeight = 18; | ||
const buttonHeight = 36; | ||
|
||
const handleCopyLinkTrack = () => { | ||
window.navigator.clipboard.writeText( | ||
`${window.location.origin}/music-player/album/${id}` | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
menuContainer: { | ||
borderRadius: layout.spacing_x1_5, | ||
position: "absolute", | ||
right: 0, | ||
bottom: buttonHeight + layout.spacing_x0_5, | ||
backgroundColor: "rgba(41, 41, 41, 1)", | ||
padding: layout.spacing_x1_5, | ||
flexDirection: "column", | ||
gap: layout.spacing_x0_75, | ||
zIndex: 999, | ||
}, | ||
unitBoxNormal: { | ||
flexDirection: "row", | ||
alignItems: "center", | ||
justifyContent: "space-between", | ||
padding: layout.spacing_x0_75, | ||
borderRadius: layout.spacing_x0_75, | ||
}, | ||
unitBoxHovered: { | ||
flexDirection: "row", | ||
alignItems: "center", | ||
justifyContent: "space-between", | ||
padding: layout.spacing_x0_75, | ||
backgroundColor: neutral33, | ||
borderRadius: layout.spacing_x0_75, | ||
}, | ||
oneLine: { | ||
flexDirection: "row", | ||
alignItems: "center", | ||
gap: layout.spacing_x1, | ||
}, | ||
text: StyleSheet.flatten([ | ||
fontSemibold13, | ||
{ | ||
color: neutralA3, | ||
}, | ||
]), | ||
divideLine: { | ||
height: 1, | ||
opacity: 0.12, | ||
backgroundColor: secondaryColor, | ||
}, | ||
shareMenuContainer: { | ||
borderRadius: layout.spacing_x1_5, | ||
position: "absolute", | ||
left: -(layout.spacing_x1_5 + shareMenuWidth), | ||
bottom: -( | ||
layout.spacing_x1_5 + | ||
lineHeight + | ||
layout.spacing_x1_5 + | ||
1 * layout.spacing_x0_75 | ||
), | ||
backgroundColor: "rgba(41, 41, 41, 1)", | ||
padding: layout.spacing_x1_5, | ||
flexDirection: "column", | ||
gap: layout.spacing_x0_75, | ||
width: shareMenuWidth, | ||
}, | ||
}); | ||
|
||
return ( | ||
<View style={styles.menuContainer}> | ||
<View style={menuContainerStyle}> | ||
<HoverView | ||
normalStyle={styles.unitBoxNormal} | ||
hoverStyle={styles.unitBoxHovered} | ||
normalStyle={unitBoxNormalStyle} | ||
hoverStyle={unitBoxHoveredStyle} | ||
onPress={() => handleCopyLinkTrack()} | ||
> | ||
<View style={styles.oneLine}> | ||
<View style={oneLineStyle}> | ||
<SVG | ||
source={Link} | ||
width={layout.spacing_x2} | ||
height={layout.spacing_x2} | ||
/> | ||
<BrandText style={styles.text}>Copy link to the track</BrandText> | ||
<SpacerRow size={1} /> | ||
<BrandText style={text}>Copy link to the track</BrandText> | ||
</View> | ||
</HoverView> | ||
</View> | ||
); | ||
}; | ||
|
||
const menuContainerStyle: ViewStyle = { | ||
borderRadius: layout.spacing_x1_5, | ||
position: "absolute", | ||
right: 0, | ||
bottom: buttonHeight + layout.spacing_x0_5, | ||
backgroundColor: "rgba(41, 41, 41, 1)", | ||
padding: layout.spacing_x1_5, | ||
zIndex: 999, | ||
}; | ||
const unitBoxNormalStyle: ViewStyle = { | ||
flexDirection: "row", | ||
alignItems: "center", | ||
justifyContent: "space-between", | ||
padding: layout.spacing_x0_75, | ||
borderRadius: layout.spacing_x0_75, | ||
}; | ||
const unitBoxHoveredStyle: ViewStyle = { | ||
flexDirection: "row", | ||
alignItems: "center", | ||
justifyContent: "space-between", | ||
padding: layout.spacing_x0_75, | ||
backgroundColor: neutral33, | ||
borderRadius: layout.spacing_x0_75, | ||
}; | ||
const oneLineStyle: ViewStyle = { | ||
flexDirection: "row", | ||
alignItems: "center", | ||
}; | ||
const text: TextStyle = { | ||
...fontSemibold13, | ||
color: neutralA3, | ||
}; |
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
Oops, something went wrong.