Skip to content

Commit 7e10a27

Browse files
authored
Merge pull request #88 from SeoJaeWan/develop
Deploy
2 parents 5203a57 + 80f2b9f commit 7e10a27

File tree

21 files changed

+368
-132
lines changed

21 files changed

+368
-132
lines changed

public/robots.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Disallow: /admin/*
55
Disallow: /client/*
66

77
# Host
8-
Host: https://rhythm-up.seojaewan.com
8+
Host: http://localhost:3001
99

1010
# Sitemaps
11-
Sitemap: https://rhythm-up.seojaewan.com/sitemap.xml
11+
Sitemap: http://localhost:3001/sitemap.xml

public/sitemap-0.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
3-
<url><loc>https://rhythm-up.seojaewan.com/manifest.json</loc><lastmod>2024-12-25T06:29:26.675Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4-
<url><loc>https://rhythm-up.seojaewan.com</loc><lastmod>2024-12-25T06:29:26.675Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
3+
<url><loc>http://localhost:3001/manifest.json</loc><lastmod>2024-12-29T03:39:27.805Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4+
<url><loc>http://localhost:3001</loc><lastmod>2024-12-29T03:39:27.805Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
55
</urlset>

public/sitemap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3-
<sitemap><loc>https://rhythm-up.seojaewan.com/sitemap-0.xml</loc></sitemap>
3+
<sitemap><loc>http://localhost:3001/sitemap-0.xml</loc></sitemap>
44
</sitemapindex>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import PlayerTemplate from "@/components/templates/player";
2+
import createMeta from "@/utils/createMeta";
3+
4+
export const metadata = createMeta({
5+
title: ` - 플레이어`,
6+
description:
7+
"혼자 관리하는 노동요는 그만! 함께 즐거운 노동요를 만들어보세요.",
8+
});
9+
10+
const Player = () => {
11+
return <PlayerTemplate />;
12+
};
13+
14+
export default Player;

src/components/atoms/common/item/index.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import ItemStyle from "./item.style";
44
import SlideText from "../../common/slideText";
55
import { color } from "@/style/theme";
66
import useTrackManager from "@/store/trackManager";
7-
import { ListType } from "@/components/molecules/common/list";
8-
import { HopeMusic } from "@/types/global";
7+
import { HopeMusic, Type } from "@/types/global";
98
import { useYoutube } from "@/hooks/useYoutube";
109

1110
interface ItemProps extends HopeMusic {
1211
index: number;
1312
delay: number;
14-
type: ListType;
13+
type: Type;
1514
}
1615

1716
const Item = (props: ItemProps) => {
@@ -41,19 +40,17 @@ const Item = (props: ItemProps) => {
4140
<SlideText>{title}</SlideText>
4241
</ItemStyle.Title>
4342
{type === "admin" && (
44-
<>
45-
<ItemStyle.Button disabled={active} onClick={handleRemove}>
46-
<RiDeleteBin6Line size={18} color={color.gray} />
47-
</ItemStyle.Button>
48-
<ItemStyle.Button
49-
$active={active}
50-
disabled={active}
51-
onClick={handleUpdate}
52-
>
53-
<IoIosPlay size={22} color={active ? color.white : color.primary} />
54-
</ItemStyle.Button>
55-
</>
43+
<ItemStyle.Button disabled={active} onClick={handleRemove}>
44+
<RiDeleteBin6Line size={18} color={color.gray} />
45+
</ItemStyle.Button>
5646
)}
47+
<ItemStyle.Button
48+
$active={active}
49+
disabled={active}
50+
onClick={handleUpdate}
51+
>
52+
<IoIosPlay size={22} color={active ? color.white : color.primary} />
53+
</ItemStyle.Button>
5754
</ItemStyle.Container>
5855
);
5956
};

src/components/molecules/admin/controller/index.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,23 @@ import TrackController from "@/components/atoms/common/trackController";
77
import { useYoutube } from "@/hooks/useYoutube";
88
import { useParams } from "next/navigation";
99
import { useAlert } from "@/hooks/useAlert";
10+
import { Type } from "@/types/global";
1011

1112
const Dump = {
1213
title: "노래를 추가해주세요.",
1314
};
1415

15-
const Controller = () => {
16+
interface ControllerProps {
17+
type: Type;
18+
}
19+
20+
const Controller = (props: ControllerProps) => {
21+
const { type } = props;
1622
const { id } = useParams<{ id: string }>();
1723
const { current, shuffleList, loopList } = useYoutube();
1824
const { addMessage } = useAlert();
1925

26+
const isAdmin = type === "admin";
2027
const playing = current || Dump;
2128

2229
const handleCopyLink = () => {
@@ -49,7 +56,9 @@ const Controller = () => {
4956

5057
<ControllerStyle.PlayingBox>
5158
<ListOption type="link" onClick={handleCopyLink} />
52-
<ListOption type="shuffle" isActive onClick={shuffleList} />
59+
{isAdmin && (
60+
<ListOption type="shuffle" isActive onClick={shuffleList} />
61+
)}
5362
<ListOption type="loop" isActive onClick={loopList} />
5463
</ControllerStyle.PlayingBox>
5564
</ControllerStyle.TopController>

src/components/molecules/client/controller/controller.style.ts

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,51 @@ import styled from "styled-components";
22

33
const Container = styled.div`
44
display: flex;
5-
align-items: center;
6-
justify-content: center;
7-
gap: 10px;
5+
flex-direction: column;
6+
justify-content: space-between;
87
98
width: 100%;
109
height: 100%;
1110
12-
padding: 0 15px;
11+
padding: 25px 15px;
1312
1413
background-color: ${(props) => props.theme.color.primary};
1514
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1);
1615
`;
1716

18-
const Title = styled.h1`
19-
flex: 1;
17+
const TopController = styled.div`
18+
display: flex;
19+
justify-content: space-between;
20+
align-items: center;
21+
`;
22+
23+
const PlayingBox = styled.div`
24+
display: flex;
25+
justify-content: flex-end;
26+
align-items: center;
27+
gap: 10px;
28+
`;
2029

21-
height: 36px;
30+
const InfoBox = styled.div`
31+
display: flex;
32+
justify-content: space-between;
33+
align-items: center;
34+
gap: 10px;
35+
`;
36+
37+
const LeftController = styled.div`
38+
flex-grow: 1;
39+
40+
display: flex;
41+
flex-direction: column;
42+
justify-content: center;
43+
align-items: flex-start;
44+
gap: 10px;
45+
`;
46+
47+
const MusicTitle = styled.h1`
48+
width: 100%;
49+
height: 40px;
2250
2351
font-size: ${(props) => props.theme.font(30)};
2452
font-weight: 600;
@@ -33,7 +61,11 @@ const Title = styled.h1`
3361

3462
const ControllerStyle = {
3563
Container,
36-
Title,
64+
TopController,
65+
PlayingBox,
66+
InfoBox,
67+
MusicTitle,
68+
LeftController,
3769
};
3870

3971
export default ControllerStyle;

src/components/molecules/client/controller/index.tsx

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,68 @@
1-
import SlideText from "@/components/atoms/common/slideText";
1+
import Play from "@/components/atoms/admin/play";
22
import ControllerStyle from "./controller.style";
3+
import ListOption from "@/components/atoms/admin/listOption";
4+
import SoundBar from "@/components/atoms/admin/soundBar";
5+
import SlideText from "@/components/atoms/common/slideText";
36
import TrackController from "@/components/atoms/common/trackController";
47
import { useYoutube } from "@/hooks/useYoutube";
8+
import { useParams } from "next/navigation";
9+
import { useAlert } from "@/hooks/useAlert";
510

611
const Dump = {
7-
title: "재생 중인 음악이 없습니다.",
12+
title: "노래를 추가해주세요.",
813
};
914

1015
const Controller = () => {
11-
const { current } = useYoutube();
16+
const { id } = useParams<{ id: string }>();
17+
const { current, loopList } = useYoutube();
18+
const { addMessage } = useAlert();
1219

1320
const playing = current || Dump;
1421

22+
const handleCopyLink = () => {
23+
const textArea = document.createElement("textarea");
24+
textArea.value = `${window.location.origin}/client/${id}`;
25+
26+
document.body.prepend(textArea);
27+
textArea.select();
28+
29+
try {
30+
document.execCommand("copy");
31+
addMessage({
32+
message: "링크가 복사되었습니다.",
33+
type: "notification",
34+
onConfirm: () => {
35+
textArea.remove();
36+
},
37+
});
38+
} catch (error) {
39+
console.error(error);
40+
} finally {
41+
textArea.remove();
42+
}
43+
};
44+
1545
return (
1646
<ControllerStyle.Container>
17-
<ControllerStyle.Title>
18-
<SlideText>{playing.title}</SlideText>
19-
</ControllerStyle.Title>
47+
<ControllerStyle.TopController>
48+
<TrackController leftTooltip />
2049

21-
<TrackController />
50+
<ControllerStyle.PlayingBox>
51+
<ListOption type="link" onClick={handleCopyLink} />
52+
<ListOption type="loop" isActive onClick={loopList} />
53+
</ControllerStyle.PlayingBox>
54+
</ControllerStyle.TopController>
55+
{/* */}
56+
<ControllerStyle.InfoBox>
57+
<ControllerStyle.LeftController>
58+
<ControllerStyle.MusicTitle>
59+
<SlideText>{playing.title}</SlideText>
60+
</ControllerStyle.MusicTitle>
61+
<SoundBar />
62+
</ControllerStyle.LeftController>
63+
{/* */}
64+
<Play />
65+
</ControllerStyle.InfoBox>
2266
</ControllerStyle.Container>
2367
);
2468
};

src/components/molecules/common/list/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import { useEffect, useRef } from "react";
33
import useTrackManager from "@/store/trackManager";
44
import Item from "@/components/atoms/common/item";
55
import { useYoutube } from "@/hooks/useYoutube";
6-
7-
export type ListType = "client" | "admin";
6+
import { Type } from "@/types/global";
87

98
interface ListProps {
10-
type: ListType;
9+
type: Type;
1110
}
1211

1312
const List = (props: ListProps) => {

src/components/templates/admin/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const AdminTemplate = () => {
5050
return (
5151
<AdminStyle.Container>
5252
<AdminStyle.Controller>
53-
<Controller />
53+
<Controller type={"admin"} />
5454
</AdminStyle.Controller>
5555
<AdminStyle.List>
5656
<List type={"admin"} />

0 commit comments

Comments
 (0)