LoginSignup
0
0

More than 3 years have passed since last update.

メモ限定公開

Last updated at Posted at 2021-06-24

/** @jsx jsx */
import React, { useState } from 'react';
import { jsx, css } from '@emotion/core';

const or = "OR" 
const and ="AND";

export const Matchitem: React.FC = (props) => {
    const [selected, setselect] = useState(or);
        return (
            <div className="App">
            <button css=
            {selected === "OR" ? 
                css` border: 1px solid #5e81f4;
                font-weight: 600;
                color:#5e81f4;
                background-color: #bdccfb;`: undefined} //参考演算子
                onClick={() => setselect("OR")}>OR</button>
                <button
                    css= {selected === "AND" ? css` font-weight: 600;
                    color:#5e81f4;
                    background-color: #bdccfb;`: undefined} //参考演算子
                    onClick={() => setselect("AND")}>AND</button>
            </div>
        );
    }
export default Matchitem;

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0