Skip to content

Commit

Permalink
Merge pull request #211 from connect-foundation/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
ocy1011 authored Dec 13, 2019
2 parents 43bdd6b + be41840 commit add5eea
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 36 deletions.
33 changes: 18 additions & 15 deletions client/src/components/common/ScoreChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,24 @@ function ScoreChart({ itemDatas }) {
}, []);
return (
<Container>
{items.map((item, index) => (
<GraphWrapper key={item.title} width={graphWidth}>
<GraphBottom index={index}>
<ItemTitle>{item.title}</ItemTitle>
</GraphBottom>
<GraphTopWrapper>
<GraphTop index={index} animationName={item.animationName}>
<GraphCount index={index} isAnswer={item.isAnswer}>
{item.playerCount}
</GraphCount>
</GraphTop>
</GraphTopWrapper>
<GraphTopLimiter />
</GraphWrapper>
))}
{items.map((item, index) => {
if (!item.title) return null;
return (
<GraphWrapper key={item.title} width={graphWidth}>
<GraphBottom index={index}>
<ItemTitle>{item.title}</ItemTitle>
</GraphBottom>
<GraphTopWrapper>
<GraphTop index={index} animationName={item.animationName}>
<GraphCount index={index} isAnswer={item.isAnswer}>
{item.playerCount}
</GraphCount>
</GraphTop>
</GraphTopWrapper>
<GraphTopLimiter />
</GraphWrapper>
);
})}
</Container>
);
}
Expand Down
1 change: 1 addition & 0 deletions client/src/components/edit/Section.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function Section({ roomId, quizsetId }) {
const { quizset } = result.data;
dispatch({ type: actionTypes.READ_QUIZSET, quizset });
}
dispatch({ type: actionTypes.RESET_DELETE_QUIZZES });

dispatch({ type: actionTypes.UPDATE_IDS, roomId, quizsetId });

Expand Down
11 changes: 8 additions & 3 deletions client/src/components/edit/SideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,14 @@ function SideBar() {
}

useEffect(() => {
window.addEventListener('resize', () =>
setWindowSize({ width: window.innerWidth, height: window.innerHeight }),
);
function changeWindowSize() {
setWindowSize({ width: window.innerWidth, height: window.innerHeight });
}

window.addEventListener('resize', changeWindowSize);
return () => {
window.removeEventListener('resize', changeWindowSize);
};
}, []);

useEffect(() => {
Expand Down
17 changes: 10 additions & 7 deletions client/src/components/inGame/HostQuizPlayingRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,16 @@ function HostQuizPlayingRoom() {
</layout.Center>
<layout.Bottom>
<layout.ItemContainer>
{roomState.currentQuiz.items.map((item, index) => (
<layout.Item key={item.title}>
<ItemList key={item.title} fontColor={colors.ITEM_COLOR[index]}>
<p>{item.title}</p>
</ItemList>
</layout.Item>
))}
{roomState.currentQuiz.items.map((item, index) => {
if (!item.title) return null;
return (
<layout.Item key={item.title}>
<ItemList key={item.title} fontColor={colors.ITEM_COLOR[index]}>
<p>{item.title}</p>
</ItemList>
</layout.Item>
);
})}
</layout.ItemContainer>
</layout.Bottom>
</layout.Background>
Expand Down
25 changes: 14 additions & 11 deletions client/src/components/inGame/PlayerQuiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@ function Selection({ currentQuiz, chooseAnswer, setIsAnswer }) {
</layout.Center>
<layout.Bottom>
<layout.ItemContainer>
{currentQuiz.items.map((item, index) => (
<layout.Item key={item.title}>
<Button
backgroundColor={colors.ITEM_COLOR[index]}
fontColor={colors.TEXT_WHITE}
onClick={e => chooseAnswer(index, e)}
>
{item.title}
</Button>
</layout.Item>
))}
{currentQuiz.items.map((item, index) => {
if (!item.title) return null;
return (
<layout.Item key={item.title}>
<Button
backgroundColor={colors.ITEM_COLOR[index]}
fontColor={colors.TEXT_WHITE}
onClick={e => chooseAnswer(index, e)}
>
{item.title}
</Button>
</layout.Item>
);
})}
</layout.ItemContainer>
</layout.Bottom>
</>
Expand Down
4 changes: 4 additions & 0 deletions client/src/reducer/hostEditReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const actionTypes = {
DELETE_QUIZ: 10,
UPDATE_IDS: 11,
CHANGE_LOADING: 12,
RESET_DELETE_QUIZZES: 13,
};

const loadingTypes = {
Expand Down Expand Up @@ -168,6 +169,9 @@ const quizsetReducer = (quizsetState, action) => {
case actionTypes.CHANGE_LOADING: {
return { ...quizsetState, loadingType: action.loadingType };
}
case actionTypes.RESET_DELETE_QUIZZES: {
return { ...quizsetState, deletedQuizzes: [] };
}
default:
return quizsetState;
}
Expand Down

0 comments on commit add5eea

Please sign in to comment.