11import React , { useEffect } from 'react' ;
22import styled from 'styled-components' ;
33
4+ import { Ending1 , Ending2 , Ending3 } from './ending-captions' ;
5+
46const OverlayModal = styled . div `
57 position: fixed;
68 top: 0;
@@ -17,25 +19,12 @@ const OverlayModal = styled.div`
1719 width: 100%;
1820` ;
1921
20- const Column = styled . div `
21- display: flex;
22- flex-direction: column;
23- align-items: center;
24- justify-content: center;
25- ` ;
26-
27- const Text = styled . span `
28- color: #020D18;
29- font-size: 30px;
30- font-weight: bold;
31- ` ;
32-
33-
3422type OverlayProps = {
3523 typeEnding : number ;
24+ language : string ;
3625} ;
3726
38- const Modal = ( { typeEnding } : OverlayProps ) => {
27+ const Modal = ( { typeEnding, language } : OverlayProps ) => {
3928 useEffect ( ( ) => {
4029 document . body . style . overflow = 'hidden' ;
4130
@@ -49,37 +38,21 @@ const Modal = ({ typeEnding }: OverlayProps) => {
4938 { /* Up the hatch, love meter low */ }
5039 {
5140 typeEnding === 1 && (
52- < Column >
53- < Text > Moustachio climbs up the hatch...</ Text >
54- < Text > and closes it behind him.</ Text >
55- < Text > Guess he really doesn't love you anymore</ Text >
56- < Text > You die.</ Text >
57- </ Column >
41+ < Ending1 language = { language } />
5842 )
59-
6043 }
6144
6245 { /* Up the hatch, love meter high */ }
6346 {
6447 typeEnding === 2 && (
65- < Column >
66- < Text > Moustachio climbs up the hatch and you scramble out after him</ Text >
67- < Text > Escaping certain death reminded him how much he loves you</ Text >
68- < Text > You both live happily ever after on a tropical deserted island</ Text >
69- < Text > Cute!</ Text >
70- </ Column >
48+ < Ending2 language = { language } />
7149 )
7250 }
7351
7452 { /* Breaking the glass, bleeding out */ }
7553 {
7654 typeEnding === 3 && (
77- < Column >
78- < Text > Punching the glass was a real dumb idea</ Text >
79- < Text > You slice your hand open and bleed to death</ Text >
80- < Text > Moustachio has to clean up the mess.</ Text >
81- < Text > So now you're dead and single.</ Text >
82- </ Column >
55+ < Ending3 language = { language } />
8356 )
8457 }
8558 </ OverlayModal >
0 commit comments