This commit is contained in:
zadit
2024-10-17 03:54:32 +07:00
parent 8f50909e1a
commit 45b958642b
5 changed files with 17 additions and 13 deletions

View File

@@ -215,6 +215,7 @@ const Header = ({
HeaderText, HeaderText,
shopId, shopId,
shopName, shopName,
shopImage,
shopOwnerId, shopOwnerId,
shopClerks, shopClerks,
tableCode, tableCode,
@@ -307,7 +308,7 @@ const Header = ({
</Title> </Title>
<div style={{ visibility: showProfile ? "visible" : "hidden" }}> <div style={{ visibility: showProfile ? "visible" : "hidden" }}>
<ProfileImage <ProfileImage
src="https://i.ibb.co.com/fpg1v8J/profile-major-icon-1024x1024-9rtgyx30.png" src={shopImage}
alt="Profile" alt="Profile"
onClick={handleImageClick} onClick={handleImageClick}
animate={showRectangle && animate} animate={showRectangle && animate}

View File

@@ -5,6 +5,7 @@
} }
.item { .item {
border-top: 2px solid #00000017;
display: flex; display: flex;
align-items: stretch; align-items: stretch;
justify-content: space-between; justify-content: space-between;
@@ -16,6 +17,8 @@
box-sizing: border-box; /* Include padding and border in the element's total width */ box-sizing: border-box; /* Include padding and border in the element's total width */
width: 100%; /* Ensure the item does not exceed the parent's width */ width: 100%; /* Ensure the item does not exceed the parent's width */
overflow: hidden; /* Prevent internal overflow */ overflow: hidden; /* Prevent internal overflow */
padding-top: 10px;
margin-bottom: -3px;
} }
.itemInvoice { .itemInvoice {

View File

@@ -1,7 +1,6 @@
/* ItemLister.module.css */ /* ItemLister.module.css */
.item-lister { .item-lister {
border-top: 1px solid #888;
width: 100%; width: 100%;
padding: 10px; /* Adjust padding as needed */ padding: 10px; /* Adjust padding as needed */
box-sizing: border-box; /* Ensure padding doesn't affect width */ box-sizing: border-box; /* Ensure padding doesn't affect width */
@@ -28,7 +27,6 @@
height: calc(49vw - 20px); height: calc(49vw - 20px);
} }
.title-container { .title-container {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -25,6 +25,7 @@ export function MusicPlayer({ socket, shopId, user, isSpotifyNeedLogin }) {
const [lyric_progress_ms, setLyricProgressMs] = useState(0); const [lyric_progress_ms, setLyricProgressMs] = useState(0);
const [subtitleColor, setSubtitleColor] = useState("black"); const [subtitleColor, setSubtitleColor] = useState("black");
const [subtitleBG, setSubtitleBG] = useState("white");
const [backgroundImage, setBackgroundImage] = useState(""); const [backgroundImage, setBackgroundImage] = useState("");
useEffect(() => { useEffect(() => {
@@ -89,8 +90,10 @@ export function MusicPlayer({ socket, shopId, user, isSpotifyNeedLogin }) {
255; 255;
if (luminance > 0.5) { if (luminance > 0.5) {
setSubtitleColor("black"); setSubtitleColor("black");
setSubtitleBG("white");
} else { } else {
setSubtitleColor("white"); setSubtitleColor("white");
setSubtitleBG("black");
} }
setBackgroundImage(imageUrl); setBackgroundImage(imageUrl);
} catch (error) { } catch (error) {
@@ -312,17 +315,20 @@ export function MusicPlayer({ socket, shopId, user, isSpotifyNeedLogin }) {
style={{ backgroundImage: `url(${backgroundImage})` }} style={{ backgroundImage: `url(${backgroundImage})` }}
> >
{currentLines.past.map((line, index) => ( {currentLines.past.map((line, index) => (
<div className="past" style={{ color: subtitleColor }} key={index}> <div className="past" style={{ color: subtitleColor,
textShadow: `2px 2px 2px ${subtitleBG}`, }} key={index}>
<p>{line.words}</p> <p>{line.words}</p>
</div> </div>
))} ))}
{currentLines.present.map((line, index) => ( {currentLines.present.map((line, index) => (
<div className="present" style={{ color: subtitleColor }} key={index}> <div className="present" style={{ color: subtitleColor,
textShadow: `2px 2px 2px ${subtitleBG}`, }} key={index}>
<p>{line.words}</p> <p>{line.words}</p>
</div> </div>
))} ))}
{currentLines.future.map((line, index) => ( {currentLines.future.map((line, index) => (
<div className="future" style={{ color: subtitleColor }} key={index}> <div className="future" style={{ color: subtitleColor,
textShadow: `2px 2px 2px ${subtitleBG}`, }} key={index}>
<p>{line.words}</p> <p>{line.words}</p>
</div> </div>
))} ))}
@@ -439,12 +445,7 @@ export function MusicPlayer({ socket, shopId, user, isSpotifyNeedLogin }) {
<h5> <h5>
{expanded {expanded
? "︿" ? "︿"
: currentSong.item && : "request your song"}
currentSong.item.album &&
currentSong.item.album.images[0] &&
currentSong.item.artists[0]
? "expand"
: "request your song"}
</h5> </h5>
</div></> </div></>
} }

View File

@@ -71,7 +71,6 @@ function CafePage({
setIsStarted(true); setIsStarted(true);
} }
} }
setLoading(false);
}; };
useEffect(() => { useEffect(() => {
@@ -118,6 +117,7 @@ function CafePage({
socket.on("joined-room", (response) => { socket.on("joined-room", (response) => {
const { isSpotifyNeedLogin } = response; const { isSpotifyNeedLogin } = response;
setNeedSpotifyLogin(isSpotifyNeedLogin); setNeedSpotifyLogin(isSpotifyNeedLogin);
setLoading(false);
}); });
} }
@@ -162,6 +162,7 @@ function CafePage({
isLogout={handleLogout} isLogout={handleLogout}
shopId={shopId} shopId={shopId}
shopName={shopName} shopName={shopName}
shopImage={config.image}
shopOwnerId={shopOwnerId} shopOwnerId={shopOwnerId}
shopClerks={shopClerks} shopClerks={shopClerks}
tableCode={table.tableCode} tableCode={table.tableCode}