Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ NEXT_PUBLIC_AHREFS_ANALYTICS_KEY=
# safe to leave empty for local development
NEXT_PUBLIC_GA_MEASUREMENT_ID=

# Third-party tracking script URL — loaded by SeoGenerator when set,
# leave empty to disable (recommended for local development)
NEXT_PUBLIC_TRACKING_URL=

# ---------- Backend / API ----------
# Strapi CMS public URL (used by the browser) — staging instance is fine for dev
NEXT_PUBLIC_STRAPI=https://staging-strapi.keepsimple.io
Expand Down Expand Up @@ -70,11 +74,6 @@ NEXTAUTH_URL=http://localhost:3005
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# ---------- LinkedIn OAuth ----------
# Setup: https://www.linkedin.com/developers/apps
LINKEDIN_CLIENT_ID=
LINKEDIN_CLIENT_SECRET=

# ---------- Discord OAuth ----------
# Setup: https://discord.com/developers/applications
DISCORD_CLIENT_ID=
Expand Down
3 changes: 0 additions & 3 deletions .env.staging.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,5 @@ NEXTAUTH_SECRET=__fill_in__
GOOGLE_CLIENT_ID=__fill_in__
GOOGLE_CLIENT_SECRET=__fill_in__

LINKEDIN_CLIENT_ID=__fill_in__
LINKEDIN_CLIENT_SECRET=__fill_in__

DISCORD_CLIENT_ID=__fill_in__
DISCORD_CLIENT_SECRET=__fill_in__
Binary file modified public/keepsimple_/assets/home-page/desktop-thumbnail-dark.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/keepsimple_/assets/home-page/desktop-thumbnail-light.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/keepsimple_/assets/home-page/mobile-thumbnail-dark.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 0 additions & 34 deletions src/assets/icons/LinkedInIcon.tsx

This file was deleted.

22 changes: 22 additions & 0 deletions src/components/Headline/Headline.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
left: 0;
}

.posterDark {
display: none;
}

.video {
width: 100%;
height: 100%;
Expand Down Expand Up @@ -248,6 +252,24 @@
background-color: #1d1b1b;
}
}
}

// Body-class driven swap — fires BEFORE React hydrates the .darkTheme prop on
// the section, so the dark poster paints on first frame instead of after the
// theme prop catches up.
:global(body.darkTheme) {
.videoContainer,
.videoContainerMobile {
background-color: #1d1b1b;

.posterLight {
display: none;
}

.posterDark {
display: block;
}
}

.contentWrapper {
.headlineContent {
Expand Down
32 changes: 20 additions & 12 deletions src/components/Headline/Headline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,19 @@ const Headline: FC<HeadlineProps> = ({ headline, darkTheme, russianView }) => {
</div>
<div className={styles.videoContainer}>
<Image
src={
darkTheme
? '/keepsimple_/assets/home-page/desktop-thumbnail-dark.webp'
: '/keepsimple_/assets/home-page/desktop-thumbnail-light.webp'
}
src="/keepsimple_/assets/home-page/desktop-thumbnail-light.webp"
alt="Hero background"
fill
priority
className={styles.poster}
className={cn(styles.poster, styles.posterLight)}
sizes="(max-width: 1440px) 50vw, 684px"
/>
<Image
src="/keepsimple_/assets/home-page/desktop-thumbnail-dark.webp"
alt="Hero background"
fill
priority
className={cn(styles.poster, styles.posterDark)}
sizes="(max-width: 1440px) 50vw, 684px"
/>
<video
Expand Down Expand Up @@ -363,15 +367,19 @@ const Headline: FC<HeadlineProps> = ({ headline, darkTheme, russianView }) => {
</div>
<div className={styles.videoContainerMobile}>
<Image
src={
darkTheme
? '/keepsimple_/assets/home-page/mobile-thumbnail-dark.webp'
: '/keepsimple_/assets/home-page/mobile-thumbnail.png'
}
src="/keepsimple_/assets/home-page/mobile-thumbnail.png"
alt="Hero background"
fill
priority
className={cn(styles.poster, styles.posterLight)}
sizes="(max-width: 786px) 100vw, 786px"
/>
<Image
src="/keepsimple_/assets/home-page/mobile-thumbnail-dark.webp"
alt="Hero background"
fill
priority
className={styles.poster}
className={cn(styles.poster, styles.posterDark)}
sizes="(max-width: 786px) 100vw, 786px"
/>
<video
Expand Down
8 changes: 0 additions & 8 deletions src/components/LogIn/LogIn.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,6 @@
background-color: #4854e0;
}
}
.linkedinBtn {
background-color: #0177b5;
color: white;

&:hover {
background-color: #015d8d;
}
}
.twitterBtn {
background-color: #000;
color: white;
Expand Down
8 changes: 0 additions & 8 deletions src/components/LogIn/LogIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import auth from '@data/auth';

import DiscordIcon from '@icons/DiscordIcon';
import GoogleIcon from '@icons/GoogleIcon';
import LinkedInIcon from '@icons/LinkedInIcon';
import MailRuIcon from '@icons/MailRuIcon';
import XIcon from '@icons/XIcon';
import YandexIcon from '@icons/YandexIcon';
Expand Down Expand Up @@ -114,13 +113,6 @@ const LogIn: FC<LogInProps> = ({ setShowLogIn }) => {
<DiscordIcon />
{copy.discord}
</button>
<button
onClick={() => handleProviderSignIn('linkedin')}
className={cn(styles.linkBtn, styles.linkedinBtn)}
>
<LinkedInIcon />
{copy.linkedin}
</button>
<button
onClick={() => handleProviderSignIn('twitter')}
className={cn(styles.linkBtn, styles.twitterBtn)}
Expand Down
6 changes: 6 additions & 0 deletions src/components/SeoGenerator/SeoGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
data-key={process.env.NEXT_PUBLIC_AHREFS_ANALYTICS_KEY}
strategy="afterInteractive"
/>
{process.env.NEXT_PUBLIC_TRACKING_URL && (
<Script
src={process.env.NEXT_PUBLIC_TRACKING_URL}
strategy="afterInteractive"
/>
)}
</>
);
};
Expand Down
1 change: 0 additions & 1 deletion src/data/auth/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const en = {
subtitle: 'Choose one of the options below',
google: 'Continue with Google',
discord: 'Continue with Discord',
linkedin: 'Continue with LinkedIn',
twitter: 'Continue with X',
mailru: 'Continue with Mail.ru',
yandex: 'Continue with Yandex',
Expand Down
1 change: 0 additions & 1 deletion src/data/auth/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const ru = {
subtitle: 'Выберите один из способов ниже',
google: 'Войти через Google',
discord: 'Войти через Discord',
linkedin: 'Войти через LinkedIn',
twitter: 'Войти через X',
mailru: 'Войти через Mail.ru',
yandex: 'Войти через Yandex',
Expand Down
4 changes: 2 additions & 2 deletions src/lib/widget/pageIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ const EXACT_DEFS: Array<[string, ExactEntry]> = [
project: 'keepsimple',
kind: 'utility',
blurbEn:
'Sign-in page (Google / LinkedIn / Discord OAuth) for keepsimple accounts.',
'Sign-in page (Google / Discord OAuth) for keepsimple accounts.',
blurbRu:
'Страница входа (Google / LinkedIn / Discord OAuth) для аккаунтов keepsimple.',
'Страница входа (Google / Discord OAuth) для аккаунтов keepsimple.',
},
],
[
Expand Down
25 changes: 25 additions & 0 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Document, { Head, Html, Main, NextScript } from 'next/document';

const themeBootstrap = `(function () {
try {
var v = localStorage.getItem('darkTheme');
if (v === 'true' && document.body) document.body.classList.add('darkTheme');
} catch (e) {}
})();`;

class MyDocument extends Document {
render() {
return (
<Html>
<Head />
<body>
<script dangerouslySetInnerHTML={{ __html: themeBootstrap }} />
<Main />
<NextScript />
</body>
</Html>
);
}
}

export default MyDocument;
30 changes: 1 addition & 29 deletions src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import NextAuth from 'next-auth';
import DiscordProvider from 'next-auth/providers/discord';
import GoogleProvider from 'next-auth/providers/google';
import LinkedInProvider from 'next-auth/providers/linkedin';
import TwitterProvider from 'next-auth/providers/twitter';
import YandexProvider from 'next-auth/providers/yandex';

Expand All @@ -14,7 +13,7 @@ const GOOGLE_AUTHORIZATION_URL =
});

/**
* Function to refresh access token for Google & LinkedIn
* Function to refresh access token for Google & Twitter
*/
async function refreshAccessToken(token) {
try {
Expand All @@ -29,10 +28,6 @@ async function refreshAccessToken(token) {
url = 'https://oauth2.googleapis.com/token';
searchParams.append('client_id', process.env.GOOGLE_CLIENT_ID);
searchParams.append('client_secret', process.env.GOOGLE_CLIENT_SECRET);
} else if (token.provider === 'linkedin') {
url = 'https://www.linkedin.com/oauth/v2/accessToken';
searchParams.append('client_id', process.env.LINKEDIN_CLIENT_ID);
searchParams.append('client_secret', process.env.LINKEDIN_CLIENT_SECRET);
} else if (token.provider === 'twitter') {
url = 'https://api.twitter.com/2/oauth2/token';
searchParams.append('client_id', process.env.TWITTER_CLIENT_ID);
Expand Down Expand Up @@ -83,29 +78,6 @@ export default NextAuth({
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
authorization: GOOGLE_AUTHORIZATION_URL,
}),
LinkedInProvider({
clientId: process.env.LINKEDIN_CLIENT_ID || '',
clientSecret: process.env.LINKEDIN_CLIENT_SECRET || '',
client: { token_endpoint_auth_method: 'client_secret_post' },
issuer: 'https://www.linkedin.com',
profile: profile => {
return {
id: profile?.sub,
name:
profile.name ||
`${profile.localizedFirstName} ${profile.localizedLastName}`,
email: profile.email,
image: profile.picture,
};
},
wellKnown:
'https://www.linkedin.com/oauth/.well-known/openid-configuration',
authorization: {
params: {
scope: 'openid profile email',
},
},
}),
DiscordProvider({
clientId: process.env.DISCORD_CLIENT_ID,
clientSecret: process.env.DISCORD_CLIENT_SECRET,
Expand Down
34 changes: 0 additions & 34 deletions src/uxcore/assets/icons/LinkedInIcon.tsx

This file was deleted.

6 changes: 6 additions & 0 deletions src/uxcore/components/SeoGenerator/SeoGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@ const SeoGenerator: FC<SeoGeneratorProps> = ({
data-key={process.env.NEXT_PUBLIC_AHREFS_ANALYTICS_KEY}
strategy="afterInteractive"
/>
{process.env.NEXT_PUBLIC_TRACKING_URL && (
<Script
src={process.env.NEXT_PUBLIC_TRACKING_URL}
strategy="afterInteractive"
/>
)}
</>
);
};
Expand Down
11 changes: 0 additions & 11 deletions src/uxcore/components/_uxcp/LogInModal/LogInModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import decisionTable from '@uxcore/data/decisionTable';

import DiscordIcon from '@uxcore/assets/icons/DiscordIcon';
import GoogleIcon from '@uxcore/assets/icons/GoogleIcon';
import LinkedInIcon from '@uxcore/assets/icons/LinkedInIcon';
import MailRuIcon from '@uxcore/assets/icons/MailRuIcon';
import XIcon from '@uxcore/assets/icons/XIcon';
import YandexIcon from '@uxcore/assets/icons/YandexIcon';
Expand All @@ -35,11 +34,9 @@ const LogInModal: FC<LoginModalProps> = ({ setShowModal, source }) => {
const { locale } = useRouter() as TRouter;
const { accountData } = useContext(GlobalContext);
const router = useRouter();
const isProduction = process.env.NEXT_PUBLIC_ENV === 'prod';
const { data: session } = useSession();
const {
singInWithGoogle,
signInWithLinkedIn,
signInWithDiscord,
signInWithTwitter,
signInWithMailRu,
Expand Down Expand Up @@ -95,14 +92,6 @@ const LogInModal: FC<LoginModalProps> = ({ setShowModal, source }) => {
>
<GoogleIcon /> <span>{singInWithGoogle}</span>
</a>
{!isProduction && (
<a
onClick={() => handleProviderSignIn('linkedin', source)}
className={styles.link}
>
<LinkedInIcon /> <span>{signInWithLinkedIn}</span>
</a>
)}
<a
onClick={() => handleProviderSignIn('discord', source)}
className={styles.link}
Expand Down
Loading
Loading