11import { Sponsor } from "models/sponsor" ;
22import { Link } from "react-router-dom" ;
3- import React , { useCallback , useEffect , useRef , useState } from "react" ;
3+ import React from "react" ;
44import styled from "styled-components" ;
55
66type Props = React . HTMLAttributes < HTMLDivElement > & {
@@ -13,43 +13,59 @@ function SponsorTable({ max, levelName, sponsors, ...rest }: Props) {
1313 return (
1414 < SponsorCard >
1515 < H3 > { levelName } </ H3 >
16- < div style = { { gridTemplateColumns : `repeat( ${ max } , 1fr)` } } >
16+ < SponsorLogoList >
1717 { sponsors . map ( ( sponsor ) => (
18- < Link to = { `/sponsoring/sponsor/${ sponsor . id } ` } relative = "path" >
19- < LogoImage image = { sponsor . logo_image } />
18+ < Link to = { `/sponsoring/sponsor/${ sponsor . id } ` } relative = "path" key = { sponsor . id } >
19+ < LogoImage $ image= { sponsor . logo_image } />
2020 </ Link >
2121 ) ) }
22- </ div >
22+ </ SponsorLogoList >
2323 </ SponsorCard >
2424 ) ;
2525}
2626
27- interface Image {
28- image : string ;
29- }
30-
3127const H3 = styled . h3 `
3228 color: #141414 !important;
29+ width: 120px;
3330` ;
3431
35- const LogoImage = styled . div < Image > `
32+ const LogoImage = styled . div < { $image : string } > `
3633 display: inline-flex;
3734 justify-content: center;
38- align-itmes : center;
35+ align-items : center;
3936 color: #141414;
40- width: 320px;
4137 height: 200px;
42- background-image: url(${ ( props ) => props . image } );
38+ background-image: url(${ ( props ) => props . $ image} );
4339 background-size: contain;
4440 background-position: center;
4541
46- & > img {
47- height: 50% ;
42+ @media only screen and (max-width: 480px) {
43+ width: 320px ;
4844 }
4945
5046 @media only screen and (max-width: 810px) {
51- width: 100%;
47+ width: 200px;
48+ }
49+
50+ @media only screen and (max-width: 1200px) {
51+ width: 240px;
5252 }
53+
54+ @media only screen and (min-width: 1200px) {
55+ width: 320px;
56+ }
57+
58+ @media only screen and (min-width: 1800px) {
59+ width: 360px;
60+ }
61+ ` ;
62+
63+ const SponsorLogoList = styled . div `
64+ display: flex;
65+ flex-wrap: wrap;
66+ column-gap: 3vw;
67+ justify-content: center;
68+ width: 100%;
5369` ;
5470
5571const SponsorCard = styled . div `
@@ -59,25 +75,14 @@ const SponsorCard = styled.div`
5975 padding: 1rem 1.5rem;
6076 align-items: center;
6177 background-color: #c2c7d0;
78+ min-width: 280px;
6279
6380 & > h3 {
6481 color: #b0a8fe;
6582 margin: 0;
66- flex: 200px;
67- }
68-
69- & > div {
70- width: 100%;
71- display: grid;
72- grid-gap: 1.5rem;
73- flex: auto;
74-
75- & > a {
76- max-height: 20rem;
77- }
7883 }
7984
80- @media only screen and (max-width: 810px ) {
85+ @media only screen and (max-width: 480px ) {
8186 flex-direction: column;
8287 margin: 1rem;
8388
@@ -86,12 +91,6 @@ const SponsorCard = styled.div`
8691 margin: 0;
8792 flex: auto;
8893 }
89-
90- & > div {
91- display: flex;
92- flex-wrap: wrap;
93- flex-direction: column;
94- }
9594 }
9695` ;
9796
0 commit comments