|
|
@ -2,6 +2,7 @@ |
|
|
|
import BestPracticeHint from './BestPracticeHint.astro'; |
|
|
|
import BestPracticeHint from './BestPracticeHint.astro'; |
|
|
|
import DownloadPopup from './DownloadPopup.astro'; |
|
|
|
import DownloadPopup from './DownloadPopup.astro'; |
|
|
|
import Icon from './Icon.astro'; |
|
|
|
import Icon from './Icon.astro'; |
|
|
|
|
|
|
|
import LoginPopup from './Login/LoginPopup.astro'; |
|
|
|
import SubscribePopup from './SubscribePopup.astro'; |
|
|
|
import SubscribePopup from './SubscribePopup.astro'; |
|
|
|
|
|
|
|
|
|
|
|
export interface Props { |
|
|
|
export interface Props { |
|
|
@ -15,23 +16,22 @@ const { title, description, bestPracticeId, isUpcoming = false } = Astro.props; |
|
|
|
const isBestPracticeReady = !isUpcoming; |
|
|
|
const isBestPracticeReady = !isUpcoming; |
|
|
|
--- |
|
|
|
--- |
|
|
|
|
|
|
|
|
|
|
|
<DownloadPopup /> |
|
|
|
<LoginPopup /> |
|
|
|
<SubscribePopup /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='border-b'> |
|
|
|
<div class='border-b'> |
|
|
|
<div class='py-5 sm:py-12 container relative'> |
|
|
|
<div class='container relative py-5 sm:py-12'> |
|
|
|
<div class='mt-0 mb-3 sm:mb-6'> |
|
|
|
<div class='mt-0 mb-3 sm:mb-6'> |
|
|
|
<h1 class='text-2xl sm:text-4xl mb-0.5 sm:mb-2 font-bold'> |
|
|
|
<h1 class='mb-0.5 text-2xl font-bold sm:mb-2 sm:text-4xl'> |
|
|
|
{title} |
|
|
|
{title} |
|
|
|
</h1> |
|
|
|
</h1> |
|
|
|
<p class='text-gray-500 text-sm sm:text-lg'>{description}</p> |
|
|
|
<p class='text-sm text-gray-500 sm:text-lg'>{description}</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class='flex justify-between'> |
|
|
|
<div class='flex justify-between'> |
|
|
|
<div class='flex gap-1 sm:gap-2'> |
|
|
|
<div class='flex gap-1 sm:gap-2'> |
|
|
|
<a |
|
|
|
<a |
|
|
|
href='/best-practices' |
|
|
|
href='/best-practices' |
|
|
|
class='bg-gray-500 py-1.5 px-3 rounded-md text-white text-xs sm:text-sm font-medium hover:bg-gray-600' |
|
|
|
class='rounded-md bg-gray-500 py-1.5 px-3 text-xs font-medium text-white hover:bg-gray-600 sm:text-sm' |
|
|
|
aria-label='Back to All Best Practices' |
|
|
|
aria-label='Back to All Best Practices' |
|
|
|
> |
|
|
|
> |
|
|
|
←<span class='hidden sm:inline'> All Best Practices</span> |
|
|
|
←<span class='hidden sm:inline'> All Best Practices</span> |
|
|
@ -40,22 +40,41 @@ const isBestPracticeReady = !isUpcoming; |
|
|
|
{ |
|
|
|
{ |
|
|
|
isBestPracticeReady && ( |
|
|
|
isBestPracticeReady && ( |
|
|
|
<button |
|
|
|
<button |
|
|
|
data-popup='download-popup' |
|
|
|
id='download-button' |
|
|
|
class='inline-flex items-center justify-center bg-yellow-400 py-1.5 px-3 text-xs sm:text-sm font-medium rounded-md hover:bg-yellow-500' |
|
|
|
data-popup='login-popup' |
|
|
|
aria-label='Download Best Practice' |
|
|
|
class='inline-flex items-center justify-center rounded-md bg-yellow-400 px-3 py-1.5 text-xs font-medium hover:bg-yellow-500 sm:text-sm' |
|
|
|
|
|
|
|
aria-label='Download Roadmap' |
|
|
|
ga-category='Subscription' |
|
|
|
ga-category='Subscription' |
|
|
|
ga-action='Clicked Popup Opener' |
|
|
|
ga-action='Clicked Popup Opener' |
|
|
|
ga-label='Download Best Practice Popup' |
|
|
|
ga-label='Download Roadmap Popup' |
|
|
|
> |
|
|
|
> |
|
|
|
<Icon icon='download' /> |
|
|
|
<Icon icon='download' /> |
|
|
|
<span class='hidden sm:inline ml-2'>Download</span> |
|
|
|
<span class='ml-2 hidden sm:inline'>Download</span> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
isBestPracticeReady && ( |
|
|
|
|
|
|
|
<a |
|
|
|
|
|
|
|
id='download-link' |
|
|
|
|
|
|
|
class='inline-flex hidden items-center justify-center rounded-md bg-yellow-400 px-3 py-1.5 text-xs font-medium hover:bg-yellow-500 sm:text-sm' |
|
|
|
|
|
|
|
aria-label='Download Roadmap' |
|
|
|
|
|
|
|
ga-category='Subscription' |
|
|
|
|
|
|
|
ga-action='Clicked Popup Opener' |
|
|
|
|
|
|
|
ga-label='Download Roadmap Popup' |
|
|
|
|
|
|
|
href={`/best-practices/${bestPracticeId}.png`} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Icon icon='download' /> |
|
|
|
|
|
|
|
<span class='ml-2 hidden sm:inline'>Download</span> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
<button |
|
|
|
data-popup='subscribe-popup' |
|
|
|
id='subscribe-button' |
|
|
|
class='inline-flex items-center justify-center bg-yellow-400 py-1.5 px-3 text-xs sm:text-sm font-medium rounded-md hover:bg-yellow-500' |
|
|
|
data-popup='login-popup' |
|
|
|
|
|
|
|
class='inline-flex items-center justify-center rounded-md bg-yellow-400 py-1.5 px-3 text-xs font-medium hover:bg-yellow-500 sm:text-sm' |
|
|
|
aria-label='Subscribe for Updates' |
|
|
|
aria-label='Subscribe for Updates' |
|
|
|
ga-category='Subscription' |
|
|
|
ga-category='Subscription' |
|
|
|
ga-action='Clicked Popup Opener' |
|
|
|
ga-action='Clicked Popup Opener' |
|
|
@ -71,7 +90,7 @@ const isBestPracticeReady = !isUpcoming; |
|
|
|
<a |
|
|
|
<a |
|
|
|
href={`https://github.com/kamranahmedse/developer-roadmap/issues/new?title=[Suggestion] ${title}`} |
|
|
|
href={`https://github.com/kamranahmedse/developer-roadmap/issues/new?title=[Suggestion] ${title}`} |
|
|
|
target='_blank' |
|
|
|
target='_blank' |
|
|
|
class='inline-flex items-center justify-center bg-gray-500 text-white py-1.5 px-3 text-xs sm:text-sm font-medium rounded-md hover:bg-gray-600' |
|
|
|
class='inline-flex items-center justify-center rounded-md bg-gray-500 px-3 py-1.5 text-xs font-medium text-white hover:bg-gray-600 sm:text-sm' |
|
|
|
aria-label='Suggest Changes' |
|
|
|
aria-label='Suggest Changes' |
|
|
|
> |
|
|
|
> |
|
|
|
<Icon icon='comment' class='h-3 w-3' /> |
|
|
|
<Icon icon='comment' class='h-3 w-3' /> |
|
|
@ -85,3 +104,19 @@ const isBestPracticeReady = !isUpcoming; |
|
|
|
<BestPracticeHint bestPracticeId={bestPracticeId} /> |
|
|
|
<BestPracticeHint bestPracticeId={bestPracticeId} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
import Cookies from 'js-cookie'; |
|
|
|
|
|
|
|
import { TOKEN_COOKIE_NAME } from '../lib/constants'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const subscribeButton = document.getElementById('subscribe-button'); |
|
|
|
|
|
|
|
const downloadButton = document.getElementById('download-button'); |
|
|
|
|
|
|
|
const downloadLink = document.getElementById('download-link'); |
|
|
|
|
|
|
|
const token = Cookies.get(TOKEN_COOKIE_NAME); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (token) { |
|
|
|
|
|
|
|
subscribeButton?.classList.add('hidden'); |
|
|
|
|
|
|
|
downloadButton?.classList.add('hidden'); |
|
|
|
|
|
|
|
downloadLink?.classList.remove('hidden'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|