Skip to content

Commit 7040df0

Browse files
committed
fix button and finishing
1 parent a8caa15 commit 7040df0

2 files changed

Lines changed: 31 additions & 28 deletions

File tree

src/components/Button.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ const StyledButton = styled.div`
55
display: inline-block;
66
width: ${({ width }) => (width ? width : '120px')};
77
height: 30px;
8-
background-color: #009d86;
8+
background-color: ${({ color }) => (color ? color : '#009d86')};
99
text-align: center;
1010
color: #fff;
1111
border-radius: 40px;
1212
box-shadow: 2px 2px 15px rgba(25, 99, 115, 0.2);
1313
padding-top: 3px;
1414
font-size: 80%;
15+
margin-bottom: 10px;
1516
cursor: pointer;
1617
${({ menubar }) =>
1718
menubar &&
@@ -27,13 +28,14 @@ const StyledButton = styled.div`
2728
`}
2829
`;
2930

30-
const Button = ({ width, menubar, subtitle, children, onClick }) => {
31+
const Button = ({ width, color, menubar, subtitle, children, onClick }) => {
3132
return (
3233
<StyledButton
3334
menubar={menubar}
3435
subtitle={subtitle}
3536
onClick={onClick}
3637
width={width}
38+
color={color}
3739
>
3840
{children}
3941
</StyledButton>

src/pages/Learn/index.js

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,10 @@ const SubWrapper = styled.div`
7878
}
7979
8080
img {
81-
/* margin-top: -3px; */
8281
margin-right: 10px;
8382
}
8483
`;
8584

86-
const Back = styled.p`
87-
font-size: 60%;
88-
color: #303030;
89-
margin: 2px 0 0 10px;
90-
&:hover {
91-
color: #009d86;
92-
}
93-
`;
94-
9585
// MODAL
9686
const customStyles = {
9787
content: {
@@ -161,12 +151,6 @@ const Padding = styled.div`
161151
padding: 0 20px;
162152
`;
163153

164-
const ScoreResult = styled.p`
165-
font-size: 120%;
166-
font-weight: bold;
167-
margin-top: 20px;
168-
`;
169-
170154
const CodeResult = styled.p`
171155
font-family: 'Fira Code', monospace;
172156
font-size: 90%;
@@ -379,10 +363,22 @@ let myArr = [];
379363
setIsOpenCTp(false);
380364
};
381365

382-
const [ctAnswer, setCTAnswer] = useState('Silahkan submit jawaban');
366+
const [ctAnswerA, setCTAnswerA] = useState('Silahkan submit jawaban');
383367

384-
const onCTsubmit = () => {
385-
setCTAnswer('Jawaban anda tepat!');
368+
const onCTsubmitA = () => {
369+
setCTAnswerA('Jawaban anda tepat!');
370+
};
371+
372+
const [ctAnswerD, setCTAnswerD] = useState('Silahkan submit jawaban');
373+
374+
const onCTsubmitD = () => {
375+
setCTAnswerD('Jawaban anda tepat!');
376+
};
377+
378+
const [ctAnswerP, setCTAnswerP] = useState('Silahkan submit jawaban');
379+
380+
const onCTsubmitP = () => {
381+
setCTAnswerP('Jawaban anda tepat!');
386382
};
387383

388384
return (
@@ -530,8 +526,13 @@ let myArr = [];
530526
<TopicDone>Materi Selesai</TopicDone>
531527
<img src={check} alt="completed" />
532528
<TopicName>Array - Perkenalan</TopicName>
529+
<Link to="/learn">
530+
<Button width="200px">Materi selanjutnya</Button>
531+
</Link>
533532
<Link to="/quiz">
534-
<Button width="200px">Lanjut Mengerjakan Kuis</Button>
533+
<Button width="200px" color="#FF175D">
534+
Lanjut Mengerjakan Kuis
535+
</Button>
535536
</Link>
536537
</ModalBox>
537538
</Modal>
@@ -581,13 +582,13 @@ let myArr = [];
581582
<p>array mempunyai nilai</p>
582583
</CheckboxItem>
583584
</CheckboxWrapper>
584-
<Button width="200px" onClick={onCTsubmit}>
585+
<Button width="200px" onClick={onCTsubmitA}>
585586
Submit jawaban
586587
</Button>
587588
<SubmitWrapper>
588589
<img src={ilustrasiA} alt="abstraksi" className="ilustrasiA" />
589590
</SubmitWrapper>
590-
<TextCT>{ctAnswer}</TextCT>
591+
<TextCT>{ctAnswerA}</TextCT>
591592
</ModalBox>
592593
</Modal>
593594
{/* Modal dekomposisi */}
@@ -637,13 +638,13 @@ let myArr = [];
637638
</CheckboxItem>
638639
</CheckboxWrapper>
639640

640-
<Button width="200px" onClick={onCTsubmit}>
641+
<Button width="200px" onClick={onCTsubmitD}>
641642
Submit jawaban
642643
</Button>
643644
<SubmitWrapper>
644645
<img src={ilustrasiD} alt="dekomposisi" className="ilustrasiD" />
645646
</SubmitWrapper>
646-
<TextCT>{ctAnswer}</TextCT>
647+
<TextCT>{ctAnswerD}</TextCT>
647648
</ModalBox>
648649
</Modal>
649650
{/* Modal Pola */}
@@ -693,13 +694,13 @@ let myArr = [];
693694
</CheckboxItem>
694695
</CheckboxWrapper>
695696

696-
<Button width="200px" onClick={onCTsubmit}>
697+
<Button width="200px" onClick={onCTsubmitP}>
697698
Submit jawaban
698699
</Button>
699700
<SubmitWrapper>
700701
<img src={ilustrasiP} alt="dekomposisi" className="ilustrasiP" />
701702
</SubmitWrapper>
702-
<TextCT>{ctAnswer}</TextCT>
703+
<TextCT>{ctAnswerP}</TextCT>
703704
</ModalBox>
704705
</Modal>
705706
</MainWrapper>

0 commit comments

Comments
 (0)