Skip to content

Commit 63adb0b

Browse files
committed
add Modern Treasury to mini sponsors
1 parent fb9e447 commit 63adb0b

File tree

5 files changed

+78
-16
lines changed

5 files changed

+78
-16
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@openfonts/luckiest-guy_latin": "^1.44.2",
1515
"@pauliescanlon/gatsby-mdx-routes": "^0.0.4",
1616
"@popperjs/core": "^2.7.0",
17+
"@tippyjs/react": "^4.2.5",
1718
"gatsby": "^2.32.3",
1819
"gatsby-dynamical-navigation": "^0.4.1",
1920
"gatsby-image": "^2.11.0",

src/components/Affiliates.js

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { StaticQuery, graphql } from 'gatsby';
33
import { ProductCard, Grid } from './ProductCard';
44
import { shuffle } from 'weighted-shuffle';
55
import styled from '@emotion/styled';
6+
import { css } from '@emotion/react';
7+
import Tippy from '@tippyjs/react';
8+
import 'tippy.js/dist/tippy.css'; // optional
69

710
const pickRandom = (array, n) =>
811
shuffle(array.map(({ probability, ...p }) => [p, probability]))
@@ -101,21 +104,30 @@ const MINI_SPONSORS = [
101104
label: 'Mobile Mall - Mobile Phone Prices in Pakistan',
102105
url: 'https://mobilemall.pk/',
103106
},
107+
{
108+
logo: require('../images/logos/sponsors/modern-treasury.svg'),
109+
label: 'Modern Treasury - The one place to keep a business’s money flowing',
110+
url: 'https://www.moderntreasury.com/',
111+
},
104112
];
105113

106114
const random = products.slice(0, 3);
107115
const bigOne = random.find((x) => x.xlImage != null);
108116

109117
const MiniSponsor = styled((props) => (
110-
<a
111-
href={props.href}
112-
target="_blank"
113-
className={props.className}
114-
title={props.alt}
115-
rel="noopener noreferrer"
116-
>
117-
<img src={props.src} alt={props.alt} width="40" height="40" />
118-
</a>
118+
<Tippy content={props.alt}>
119+
<a
120+
css={css`
121+
display: block;
122+
`}
123+
href={props.href}
124+
target="_blank"
125+
className={props.className}
126+
rel="noopener noreferrer"
127+
>
128+
<img src={props.src} alt={props.alt} width="40" height="40" />
129+
</a>
130+
</Tippy>
119131
))`
120132
opacity: 0.2;
121133
transition: opacity 0.2s ease-in-out;
@@ -200,13 +212,21 @@ export const Sponsors = () => {
200212

201213
<div style={{ height: '2em' }} />
202214

203-
{MINI_SPONSORS.map((sponsor) => (
204-
<MiniSponsor
205-
src={sponsor.logo}
206-
alt={sponsor.label}
207-
href={sponsor.url}
208-
/>
209-
))}
215+
<div
216+
css={css`
217+
display: flex;
218+
justify-content: center;
219+
flex-wrap: wrap;
220+
`}
221+
>
222+
{MINI_SPONSORS.map((sponsor) => (
223+
<MiniSponsor
224+
src={sponsor.logo}
225+
alt={sponsor.label}
226+
href={sponsor.url}
227+
/>
228+
))}
229+
</div>
210230
</>
211231
);
212232
};

src/components/layout.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ h2,
1616
h3 {
1717
font-weight: normal;
1818
}
19+
20+
.tippy-content {
21+
text-align: center;
22+
}
Lines changed: 18 additions & 0 deletions
Loading

yarn.lock

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2771,6 +2771,11 @@
27712771
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.7.0.tgz#5f7760965170f7f1e2910d2498c5be88b47a2a8c"
27722772
integrity sha512-V3WyEc8ZyAuOQ2fpFuTuYYOd2tV4NePeSdxaHYgYAOs7ERLxlcFi2XsmgI5LJFdAUmJKXsg8jaIiVTkTHQygQw==
27732773

2774+
"@popperjs/core@^2.9.0":
2775+
version "2.10.2"
2776+
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.10.2.tgz#0798c03351f0dea1a5a4cabddf26a55a7cbee590"
2777+
integrity sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==
2778+
27742779
"@prefresh/babel-plugin@^0.4.0":
27752780
version "0.4.0"
27762781
resolved "https://registry.yarnpkg.com/@prefresh/babel-plugin/-/babel-plugin-0.4.0.tgz#78ca60adb51095b20e6afdaadc1015e549ae89c9"
@@ -2876,6 +2881,13 @@
28762881
dependencies:
28772882
defer-to-connect "^2.0.0"
28782883

2884+
"@tippyjs/react@^4.2.5":
2885+
version "4.2.5"
2886+
resolved "https://registry.yarnpkg.com/@tippyjs/react/-/react-4.2.5.tgz#9b5837db93a1cac953962404df906aef1a18e80d"
2887+
integrity sha512-YBLgy+1zznBNbx4JOoOdFXWMLXjBh9hLPwRtq3s8RRdrez2l3tPBRt2m2909wZd9S1KUeKjOOYYsnitccI9I3A==
2888+
dependencies:
2889+
tippy.js "^6.3.1"
2890+
28792891
"@tokenizer/token@^0.1.1":
28802892
version "0.1.1"
28812893
resolved "https://registry.yarnpkg.com/@tokenizer/token/-/token-0.1.1.tgz#f0d92c12f87079ddfd1b29f614758b9696bc29e3"
@@ -17086,6 +17098,13 @@ tinycolor2@^1.4.1:
1708617098
resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8"
1708717099
integrity sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g=
1708817100

17101+
tippy.js@^6.3.1:
17102+
version "6.3.2"
17103+
resolved "https://registry.yarnpkg.com/tippy.js/-/tippy.js-6.3.2.tgz#c03a0b88f170dffeba42f569771801dddc1f6340"
17104+
integrity sha512-35XVQI7Zl/jHZ51+8eHu/vVRXBjWYGobPm5G9FxOchj4r5dWhghKGS0nm0ARUKZTF96V7pPn7EbXS191NTwldw==
17105+
dependencies:
17106+
"@popperjs/core" "^2.9.0"
17107+
1708917108
title-case@^2.1.0:
1709017109
version "2.1.1"
1709117110
resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.1.tgz#3e127216da58d2bc5becf137ab91dae3a7cd8faa"

0 commit comments

Comments
 (0)