@fortawesome/free-solid-svg-icons#faMedal JavaScript Examples

The following examples show how to use @fortawesome/free-solid-svg-icons#faMedal. 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: ParticipationRace.js    From ponce-tournois-mario-kart with MIT License 5 votes vote down vote up
function ParticipationRace({ race, canManage, nbRace }) {
    const [showForm, setShowForm] = useState(false);

    const openForm = () => {
        if (!showForm && canManage) setShowForm(true);
    };

    const closeForm = () => {
        setShowForm(false);
    };

    return (
        <Row>
            <Col xs={12} onClick={openForm}>
                <div
                    className={`participation__race ${
                        !showForm && canManage ? 'participation__addRace' : ''
                    }`}
                >
                    <Row align="center">
                        {showForm ? (
                            <EditRaceForm closeForm={closeForm} race={race} />
                        ) : (
                            <>
                                {race.disconnected && (
                                    <div className="participation__disconnectedRace">
                                        <NoWifiIcon />
                                    </div>
                                )}
                                <Col xs={2}>{nbRace}</Col>
                                <Col xs={2}>
                                    {race.position <= 3 ? (
                                        <FontAwesomeIcon
                                            icon={faMedal}
                                            color={getPositionColor(
                                                race.position
                                            )}
                                        />
                                    ) : (
                                        race.position
                                    )}
                                </Col>
                                <Col xs={2}>{race.nbPoints}</Col>
                                <Col xs={6}>{race.Track.name}</Col>
                            </>
                        )}
                    </Row>
                </div>
            </Col>
        </Row>
    );
}