Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/hacktoberfest bi #417

Merged
merged 4 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
24 changes: 22 additions & 2 deletions components/Common/ContentBox/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
import PropTypes from 'prop-types';
import Button from '../Button';
import * as analytics from '../../../lib/analytics';
import { useCallback } from 'react';

const ContentBox = ({
title,
body,
ctaLabel,
ctaUrl,
className,
eventName,
}) => {
const handleCtaClick = useCallback(() => {
analytics.event({
action: eventName,
params: {
ctaLabel: ctaLabel,
},
});
}, [eventName, ctaLabel]);

const ContentBox = ({ title, body, ctaLabel, ctaUrl, className }) => {
return (
<>
<div className={`text-sm font-normal ${className} `}>
Expand All @@ -13,7 +31,7 @@ const ContentBox = ({ title, body, ctaLabel, ctaUrl, className }) => {
backgroundColor="transparent"
hoverBackgroundColor="transparent"
isLink={true}
//onClick={handleStartNowClick}
onClick={handleCtaClick}
href={ctaUrl}
className="mt-8 border border-1 border-white rounded !py-1.5 !px-3 inline-flex"
delayLinkMs={300}
Expand All @@ -30,6 +48,7 @@ ContentBox.propTypes = {
ctaLabel: PropTypes.string,
ctaUrl: PropTypes.string,
className: PropTypes.string,
eventName: PropTypes.string,
};

ContentBox.defaultProps = {
Expand All @@ -38,6 +57,7 @@ ContentBox.defaultProps = {
ctaLabel: '',
ctaUrl: '',
className: '',
eventName: '',
};

export default ContentBox;
16 changes: 16 additions & 0 deletions components/Header/TopBar/hacktoberfest.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Link from 'next/link';

const HacktoberfestBar = () => {
return (
<div className="relative z-10 w-full bg-light-blue laptop:mb-[-1px]">
<Link href="/hacktoberfest-2023">
<a className="font-jetbrains w-full flex justify-center text-xs text-center items-center max-w-container m-container p-container py-2 cursor-pointer hover:opacity-50 transition-opacity duration-300">
Amplication is a proud sponsor of Hacktoberfest 2023. Click here to
participate.
</a>
</Link>
</div>
);
};

export default HacktoberfestBar;
7 changes: 4 additions & 3 deletions components/Header/index.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import TopBar from './TopBar';
// import TopBar from './TopBar';
import HacktoberfestBar from './TopBar/hacktoberfest';
import MainBar from './MainBar';
import BottomBar from './BottomBar';

const Header = () => {
const Header = ({ hideBar = false }) => {
return (
<>
<header className="z-20 font-poppins laptop:fixed laptop:w-full laptop:top-0 h-[150px]">
<div className="fixed w-full">
<TopBar />
{!hideBar && <HacktoberfestBar />}
<MainBar />
<BottomBar />
</div>
Expand Down
1 change: 1 addition & 0 deletions components/Sections/Hacktoberfest/Steps/how-to1.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const HowTo1 = () => {
ctaLabel="See issues"
ctaUrl="https://github.com/amplication/amplication/issues?q=is%3Aopen+is%3Aissue+label%3A%22open+to+community%22"
className="pl-36 z-20"
eventName={'ClickHacktoberfestIssues'}
/>
</>
}
Expand Down
1 change: 1 addition & 0 deletions components/Sections/Hacktoberfest/Steps/how-to2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const HowTo2 = () => {
ctaLabel="Check plugin ideas"
ctaUrl="https://github.com/amplication/amplication/issues/7027"
className="pl-36 z-20"
eventName={'ClickHacktoberfestPlugins'}
/>
</>
}
Expand Down
1 change: 1 addition & 0 deletions components/Sections/Hacktoberfest/Steps/how-to3.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const HowTo3 = () => {
ctaLabel="Learn More"
ctaUrl="https://github.com/amplication/amplication/issues/7028"
className="pl-36 z-20"
eventName={'ClickHacktoberfestBuildApp'}
/>
</>
}
Expand Down
1 change: 1 addition & 0 deletions components/Sections/Hacktoberfest/Steps/open-source.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const OpenSource = () => {
}
ctaLabel="How to contribute"
ctaUrl="https://github.com/amplication/amplication/issues/7026"
eventName={'ClickHacktoberfestHowToContribute'}
/>
}
SecondSectionNode={
Expand Down
1 change: 1 addition & 0 deletions components/Sections/Hacktoberfest/Steps/win.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const Win = () => {
}
ctaLabel="Read the rules"
ctaUrl="https://github.com/amplication/amplication/issues/7030"
eventName={'ClickHacktoberfestRules'}
/>
);
};
Expand Down
5 changes: 4 additions & 1 deletion layouts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const MainLayout = ({
footerCompactView,
footerClass,
paddingTopClasses,
hideTopBar = false
}) => {
return (
<div
Expand All @@ -17,7 +18,7 @@ const MainLayout = ({
paddingTopClasses,
)}
>
<Header />
<Header hideBar={hideTopBar} />
{children}
<Footer
customClass={footerClass}
Expand All @@ -34,13 +35,15 @@ MainLayout.propTypes = {
footerCompactView: PropTypes.bool,
footerClass: PropTypes.string,
paddingTopClasses: PropTypes.string,
hideTopBar: PropTypes.bool
};

MainLayout.defaultProps = {
hideFooterBanner: false,
footerCompactView: false,
footerClass: '',
paddingTopClasses: 'laptop:pt-[110px]',
hideTopBar: false
};

export { MainLayout };
2 changes: 1 addition & 1 deletion pages/hacktoberfest-2023.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ Hacktoberfest.defaultProps = {
};

Hacktoberfest.getLayout = function getLayout(page) {
return <MainLayout paddingTopClasses={"laptop:pt-[90px]"} hideFooterBanner={false} >{page}</MainLayout>;
return <MainLayout hideTopBar={true} paddingTopClasses={"laptop:pt-[90px]"} hideFooterBanner={false} >{page}</MainLayout>;
};
export default Hacktoberfest;
Loading
Loading