Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/img/studydo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="%PUBLIC_URL%/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo1.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand All @@ -31,7 +31,7 @@
crossorigin="anonymous"
/>
<!-- reactbootstrap -->
<title>React App</title>
<title>STUDY.DO</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file added public/logo.ico
Binary file not shown.
Binary file added public/logo1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 79 additions & 8 deletions src/components/AllStudy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,59 @@ import styled from 'styled-components';
import axios from 'axios';
import {Card,Button} from 'react-bootstrap';

const Container = styled.div`
padding: 20px;
`;

//
const Ranking_font = styled.div`
font-size: xx-large;
font-weight: bold;
`;
//

const Date_font = styled.div`
font-size: large;
font-weight: bold;
text-align: center;
`;

const ContentBox = styled.div`
display: flex;
gap: 0.25rem;

align-items: center;
grid-area: content;
justify-content: center;
`;
const Content1 = styled.div`
padding: 0.25rem;
// background: yellow;
text-align: left;
width: 30%;
height: 100%;
`;
const Content2 = styled.div`
padding: 0.25rem;
// background: yellow;
text-align: left;
width: 70%;
height: 100%;
font-size: large;
`;
const Content3 = styled.div`
padding: 0.25rem;
// background: yellow;
text-align: center;
width: 0%;
height: 100%;
`;

const StudiesComp = (props) => {
axios.defaults.withCredentials = true;
const study = props.study;

const URL = '/api/studies/join';
const URL = 'https://nudo-study.cf/api/studies/join';

const [join, setJoin] = useState(null);
// const [click, setClick] = useState(false);
Expand Down Expand Up @@ -45,17 +94,39 @@ const StudiesComp = (props) => {
<Card.Body>
<Card.Title>{study.title}</Card.Title>
<Card.Text>
목표 시간: {study.target_time} <br/>
멤버 수: {study.member_number} <br/>
하루 벌금: {study.penalty} <br/>
스터디 정보: {study.info} <br/>
방장이름: {study.leader} <br/>
스터디 아이디: {study.id} <br/>
<ContentBox>
<Content1>방장</Content1>
<Content2>{study.leader}</Content2>
<Content3></Content3>
</ContentBox>
<hr/>
<ContentBox>
<Content1>목표 시간</Content1>
<Content2>{study.target_time}</Content2>
<Content3></Content3>
</ContentBox>
<ContentBox>
<Content1>하루 벌금</Content1>
<Content2>{study.penalty}</Content2>
<Content3></Content3>
</ContentBox>
<ContentBox>
<Content1>멤버 수</Content1>
<Content2>{study.member_number}</Content2>
<Content3></Content3>
</ContentBox>
<hr/>
<ContentBox>
<Content1>스터디 정보</Content1>
<Content2>{study.info}</Content2>
<Content3></Content3>
</ContentBox>
<hr/>
</Card.Text>
{
(study.is_recruit === true)?
<>
<Button onClick={() => {fetchJoin()}}>JOIN</Button>
<Button variant="dark" onClick={() => {fetchJoin()}}>JOIN</Button>
</>
: null
}
Expand Down
93 changes: 86 additions & 7 deletions src/components/MyStudy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,64 @@ import { withRouter } from 'react-router';
import {createBrowserHistory} from 'history';
import axios from 'axios';
import {Card,Button} from 'react-bootstrap';
import styled from 'styled-components';

const Container = styled.div`
padding: 20px;
`;

//
const Ranking_font = styled.div`
font-size: xx-large;
font-weight: bold;
`;
//

const Date_font = styled.div`
font-size: large;
font-weight: bold;
text-align: center;
`;

const ContentBox = styled.div`
display: flex;
gap: 0.25rem;

align-items: center;
grid-area: content;
justify-content: center;
`;
const Content1 = styled.div`
padding: 0.25rem;
// background: yellow;
text-align: left;
width: 30%;
height: 100%;
`;
const Content2 = styled.div`
padding: 0.25rem;
// background: yellow;
text-align: left;
width: 70%;
height: 100%;
font-size: large;
`;
const Content3 = styled.div`
padding: 0.25rem;
// background: yellow;
text-align: center;
width: 0%;
height: 100%;
`;

const MyStudy = (props) => {
axios.defaults.withCredentials = true;
const mystudy = props.mystudy;
const mystudy_id = mystudy.id;

const URL_room = '/api/studies/do/'+mystudy_id;
const URL_recruit = '/api/studies/completed/'+mystudy_id;
const URL_delete = '/api/studies/setting/'+mystudy_id;
const URL_room = 'https://nudo-study.cf/api/studies/do/'+mystudy_id;
const URL_recruit = 'https://nudo-study.cf/api/studies/completed/'+mystudy_id;
const URL_delete = 'https://nudo-study.cf/api/studies/setting/'+mystudy_id;

const fetchRoom = async () => {
try{
Expand Down Expand Up @@ -66,19 +116,48 @@ const MyStudy = (props) => {
<Card.Body>
<Card.Title>{mystudy.title}</Card.Title>
<Card.Text>
목표 시간: {mystudy.target_time} <br/>
<ContentBox>
<Content1>방장</Content1>
<Content2>{mystudy.leader}</Content2>
<Content3></Content3>
</ContentBox>
<hr/>
<ContentBox>
<Content1>목표 시간</Content1>
<Content2>{mystudy.target_time}</Content2>
<Content3></Content3>
</ContentBox>
<ContentBox>
<Content1>하루 벌금</Content1>
<Content2>{mystudy.penalty}</Content2>
<Content3></Content3>
</ContentBox>
<ContentBox>
<Content1>멤버 수</Content1>
<Content2>{mystudy.member_number}</Content2>
<Content3></Content3>
</ContentBox>
<hr/>
<ContentBox>
<Content1>스터디 정보</Content1>
<Content2>{mystudy.info}</Content2>
<Content3></Content3>
</ContentBox>
<hr/>

{/* 목표 시간: {mystudy.target_time} <br/>
멤버 수: {mystudy.member_number} <br/>
하루 벌금: {mystudy.penalty} <br/>
스터디 정보: {mystudy.info} <br/>
방장이름: {mystudy.leader} <br/>
스터디 아이디: {mystudy.id} <br/>
스터디 아이디: {mystudy.id} <br/> */}
</Card.Text>
{
(mystudy.is_recruit===false)?
<>
<Button size="sm" onClick={() => {fetchRoom()}}>공부 시작</Button>
<Button size="sm" variant="dark" onClick={() => {fetchRoom()}}>공부 시작</Button>
&nbsp;
<Button size="sm" onClick={() => {enterManage()}}>관리</Button>
<Button size="sm" variant="dark" onClick={() => {enterManage()}}>관리</Button>
&nbsp;
</>
:
Expand Down
Loading