react-syntax-highlighter/dist/esm/styles/hljs#tomorrowNight JavaScript Examples

The following examples show how to use react-syntax-highlighter/dist/esm/styles/hljs#tomorrowNight. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AnswerBoard.js    From python-level-challenge with MIT License 5 votes vote down vote up
render() {
        return (
            <Wrapper>
                <Header>

                </Header>
                <ReturnButton marginLeft={24}
                              marginTop={19}
                              onClick={() => this.props.history.goBack()}>
                    {'< Result'}
                </ReturnButton>

                <SubjectText marginLeft={24} marginRight={24}>
                    {`${this.state.question.Subject}`}
                </SubjectText>

                <QuestionText marginLeft={24} marginRight={24}>
                    {`${this.state.question.Question}`}
                </QuestionText>

                <SyntaxHighlighterWrapper>
                    {this.state.question.Code &&
                    <SyntaxHighlighter customStyle={{padding: '16px'}}
                                       codeTagProps={{style: {fontFamily: 'IBM Plex Mono'}}}
                                       language={this.props.language}
                                       style={tomorrowNight}>
                        {this.state.question.Code}
                    </SyntaxHighlighter>}
                </SyntaxHighlighterWrapper>

                {
                    (this.state.correct ? (
                            <SelectText color={'#56CCF2'}>Correct</SelectText>)
                        : (<SelectText color={'#EB5757'}>Wrong</SelectText>))
                }

                <ButtonWrapper>
                    {this.state.question.Answers.map((answer, i) => {
                        let buttonColor = '#f2f2f2';
                        let checkBox = null;

                        if (answer) {
                            if (this.state.correct) {
                                if (i === this.state.userAnswer) {
                                    checkBox = correctWhiteImagePath;
                                    buttonColor = '#56CCF2';
                                }
                            } else {
                                if (i === this.state.userAnswer) {
                                    checkBox = incorrectImagePath;
                                    buttonColor = '#EB5757';
                                } else if (i ===
                                    this.state.originalAnswer) {
                                    checkBox = correctBlueImagePath;
                                }
                            }

                            return (
                                <AnswerWrapper backgroundColor={buttonColor} key={i}>
                                    <BoxWrapper flex={1}>
                                        <Box src={checkBox}/>
                                    </BoxWrapper>

                                    <Answer flex={6}>
                                        {this.state.question.Answers[i]}
                                    </Answer>

                                    <BoxWrapper flex={1}>
                                    </BoxWrapper>
                                </AnswerWrapper>
                            );
                        } else {
                            return null;
                        }
                    })}
                </ButtonWrapper>
            </Wrapper>
        );
    }
Example #2
Source File: QuestionBoard.js    From python-level-challenge with MIT License 5 votes vote down vote up
render() {
        const { count } = this.state;
        const { questions, language } = this.props;

        return (
            <Wrapper>
                <Header>
                    <CountText marginLeft={24} marginTop={24} marginRight={24}>
                        {`${count + 1}/${this.props.questions.length}`}
                    </CountText>
                </Header>

                <SubjectText marginLeft={24} marginRight={24}>
                    {`${questions[count].Subject}`}
                </SubjectText>

                <QuestionText marginLeft={24} marginRight={24}>
                    {`${questions[count].Question}`}
                </QuestionText>

                <SyntaxHighlighterWrapper>
                    {questions[count].Code &&
                    <SyntaxHighlighter customStyle={{padding: '16px', whiteSpace: 'pre-wrap', wordBreak: 'break-word'}}
                        codeTagProps={{style: {fontFamily: 'IBM Plex Mono', fontSize: '1.2rem'}}}
                                       language={language}
                                       style={tomorrowNight}
                                       >
                        {questions[count].Code}
                    </SyntaxHighlighter>}
                </SyntaxHighlighterWrapper>

                <SelectText>
                    {`Select an answer`}
                </SelectText>

                <ButtonWrapper>
                    {questions[count].Answers.map((answer, i) => {
                        if (answer) {
                            return (
                                <AnswerButton
                                    key={`${count}-${i}`}
                                    onClick={() => this.onButtonClick(i, questions[count].Id)}>
                                    {questions[count].Answers[i]}
                                </AnswerButton>
                            )
                        }
                    })}
                </ButtonWrapper>

                {this.renderRedirect()}
            </Wrapper>
        );
    }