aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/LandingPage/PartnerList.js
blob: a443e3edea8488d91cdc1ef22e20baaa4a4c0b0f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import React, { useState } from "react";
import styled from 'styled-components';
// import { graphql, useStaticQuery } from "gatsby";
// import Img from "gatsby-image";
import {
  MOBILE_WIDTH,
} from 'src/constants/app';
import Byzantine from 'src/images/partner/Byzantine.inline.svg';
import KryptoGO from 'src/images/partner/kryptogo.inline.svg';
import Portto from 'src/images/partner/portto.inline.svg';
import Solar from 'src/images/partner/solar.inline.svg';

const Wrapper = styled.div`
  font-family: Avenir;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 60px;
  /* justify-content: center; */
  @media screen and (max-width: ${MOBILE_WIDTH}px) {
    /* padding: 50px 10px; */
  }
`;

const GridLayout = styled.div`
  /* border: 1px solid red; */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  /* border: 1px solid #DDD; */
`;

const Item = styled.div`
  flex: 1 0 21%;
  display: flex;
  justify-content: center;
  margin: 10px;
  cursor: pointer;
  @media screen and (max-width: ${MOBILE_WIDTH}px) {
    flex: 1 0 34%;
  }
`;

const PartnerLogo = styled.div`
  height: 100px;
  display: flex;
  align-items: center;
  fill: #585858;
`;

const COMMENT_HEIGHT = 280;

const Comment = styled.div`
  position: absolute;
  color: #e05b21;
  width: 80vw;
  max-width: 813px;
  height: ${COMMENT_HEIGHT}px;
  box-shadow: 0 2px 30px 0 rgba(0, 0, 0, 0.1);
  background-color: white;
  bottom: -${COMMENT_HEIGHT / 5}px;
  display: flex;
  flex-direction: column;
  align-items: center;
`;

const CommentPadding = styled.div`
  position: relative;
  height: ${COMMENT_HEIGHT}px;
  width: 100%;
  display: flex;
  justify-content: center;
`;

const PartnerInfo = {
  byzantine: {
    name: 'Byzantine Lab',
    commenter: '林冠吾, CEO',
    comment: 'I like to eat pizza, how about you?',
    logo: <Byzantine />,
  },
  sola: {
    name: 'Sola',
    commenter: '不認識, ',
    comment: 'I like to drink beer',
    logo: <Solar />,
  },
  portto: {
    name: 'Portto.',
    commenter: '玄哥, C玄O',
    comment: 'I am Portto, Portto is me',
    logo: <Portto />,
  },
  kryptogo: {
    name: 'Krypto GO',
    commenter: '歐柯登, CEO',
    comment: 'KordanGO is a company yoyoyo',
    logo: <KryptoGO />,
  },
};

const PartnerComment = styled.div`
  font-size: 24px;
  margin-top: 80px;
  font-weight: bold;
  text-align: center;
`;
const CommentLogo = styled.div`
  flex: 1;
  display: flex;
  align-items: center;
  fill: #e05b21;
`;
const Commenter = styled.div`
  padding-bottom: 30px;
`

const PartnerList = () => {
  const [selectedPartner, setSelectedPartner] = useState(PartnerInfo.kryptogo);
  const { comment, logo, commenter, name } = selectedPartner;
  return (
    <Wrapper>
      <GridLayout>
        {Object.keys(PartnerInfo).map(
          (it, key) => (<Item
            key={key}
            onClick={() => setSelectedPartner(PartnerInfo[it])}
          >
            <PartnerLogo>{PartnerInfo[it].logo}</PartnerLogo>
          </Item>)
        )}
        {Object.keys(PartnerInfo).map(
          (it, key) => (<Item
            key={key}
            onClick={() => setSelectedPartner(PartnerInfo[it])}
          >
            <PartnerLogo>{PartnerInfo[it].logo}</PartnerLogo>
          </Item>)
        )}
      </GridLayout>
      <CommentPadding>
        <Comment>
          <PartnerComment>"{comment}"</PartnerComment>
          <CommentLogo>{logo}</CommentLogo>
          <Commenter>{commenter} - {name}</Commenter>
        </Comment>
      </CommentPadding>
    </Wrapper>
  );
};

export default PartnerList;