Skip to content
Open
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
3 changes: 3 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@emotion/styled": "^11.3.0",
"@fontsource/lexend": "^4.4.5",
"@fontsource/poppins": "^4.5.0",
"@splitbee/web": "^0.2.4",
"framer-motion": "^4.1.17",
"next": "^11.0.0",
"next-pwa": "^5.2.21",
Expand Down
6 changes: 4 additions & 2 deletions src/components/AccessibleLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ import Link, { LinkProps } from "next/link";

type AccessibleLinkProps = LinkProps & ChakraLinkProps;

const AccessibleLink = ({
const AccessibleLink:React.FC<AccessibleLinkProps> = ({
href,
isExternal,
children,
as,
role,
onClick,
...props
}: AccessibleLinkProps) => {
}) => {
return (
<Link href={href} as={as} passHref>
<ChakraLink
isExternal={isExternal}
role={role}
aria-label={props["aria-label"]}
onClick={onClick}
>
{children}
</ChakraLink>
Expand Down
5 changes: 4 additions & 1 deletion src/components/homepage/Article/Article.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import {
Button,
Link,
} from "@chakra-ui/react";
import splitbee from "@splitbee/web";
import { SPLITBEE_EVENTS_NAME } from "constants/eventSplitbee";
import { WEBINAR_LINK } from "constants/paths";
import ArticleCard from "./ArticleCard";

export default function Article() {
Expand Down Expand Up @@ -52,7 +55,7 @@ export default function Article() {
Our Latest Articles
</Heading>
<Link href="https://logosid.xyz" role="link" isExternal>
<Button variant="primary">Visit Our Website</Button>
<Button variant="primary" onClick={()=> splitbee.track(SPLITBEE_EVENTS_NAME.REGISTER_WEBINAR,{link: WEBINAR_LINK})}>Visit Our Website</Button>
</Link>
</Box>

Expand Down
5 changes: 4 additions & 1 deletion src/components/homepage/Cta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import {
Image,
VStack,
} from "@chakra-ui/react";
import splitbee from "@splitbee/web";
import { SPLITBEE_EVENTS_NAME } from "constants/eventSplitbee";
import { WEBINAR_LINK } from "constants/paths";
import AccessibleLink from "../AccessibleLink";

const Cta = () => {
Expand Down Expand Up @@ -39,7 +42,7 @@ const Cta = () => {
href="https://karyakarsa.com/logos_id"
isExternal
>
<Button>Support Us</Button>
<Button onClick={()=> splitbee.track(SPLITBEE_EVENTS_NAME.SUPPORT, {link: WEBINAR_LINK})}>Support Us</Button>
</AccessibleLink>
</VStack>
</GridItem>
Expand Down
68 changes: 35 additions & 33 deletions src/components/homepage/FollowUs.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
import { VStack, HStack, Heading } from "@chakra-ui/react";
import { VStack, HStack, Heading, Button } from "@chakra-ui/react";
import AccessibleLink from "@/components/AccessibleLink";
import Instagram from "../icons/Instagram";
import Spotify from "../icons/Spotify";
import Twitter from "../icons/Twitter";
import Youtube from "../icons/Youtube";
import splitbee from "@splitbee/web";
import { SPLITBEE_EVENTS_NAME } from "constants/eventSplitbee";
import { SOCIAL_MEDIA } from '../../constants/data';
import { Instagram, Spotify, Twitter, Youtube} from '../icons/index';

const FollowUs = () => {
const renderIcon = (type: string) => {
switch (type) {
case "instagram":
return <Instagram boxSize="64px" color="pink.500" />
case "spotify":
return <Spotify boxSize="64px" color="pink.500" />
case "twitter":
return <Twitter width="60px" height="64px" color="pink.500" />
case "youtube":
return <Youtube width="92px" height="64px" color="pink.500" />
default:
break;
}
}

const renderItem = (item:any, index: number) => {
return (
<AccessibleLink
key={index}
href={item.link}
isExternal
aria-label={item.label}
onClick={()=> splitbee.track(SPLITBEE_EVENTS_NAME.EXTERNAL_LINK, {type: item.label, link:item.link})}
>
{renderIcon(item.label)}
</AccessibleLink>
);
};

return (
<VStack spacing="64px" as="section" mb="140px" id="sosial-media">
<Heading variant="h1" as="h1" color="black.primary">
Follow Us
</Heading>
<HStack minW="555px" spacing="111px">
<AccessibleLink
href="https://instagram.com/_logosid"
isExternal
aria-label="Instagram"
>
<Instagram boxSize="64px" color="pink.500" />
</AccessibleLink>
<AccessibleLink
href="https://open.spotify.com/show/2bwe0dyWnFKmqXaYCSwhML?si=VflhXjXRQqCL0VTVTO2_Zw&nd=1"
isExternal
aria-label="Spotify"
>
<Spotify boxSize="64px" color="pink.500" />
</AccessibleLink>
<AccessibleLink
href="https://twitter.com/logos_id"
isExternal
aria-label="Twitter"
>
<Twitter width="60px" height="64px" color="pink.500" />
</AccessibleLink>
<AccessibleLink
href="https://www.youtube.com/channel/UCh3AnUWH0gaiRi-ibilRj2Q"
isExternal
aria-label="Youtube"
>
<Youtube width="92px" height="64px" color="pink.500" />
</AccessibleLink>
{SOCIAL_MEDIA.map((item, index)=>renderItem(item, index))}
</HStack>
</VStack>
);
Expand Down
16 changes: 13 additions & 3 deletions src/components/homepage/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import {
} from "@chakra-ui/react";
import Image from "next/image";
import HeroImage from "@/public/img/hero.png";
import splitbee from "@splitbee/web";
import { SPLITBEE_EVENTS_NAME } from "constants/eventSplitbee";
import { SUPPORT_LINK, WEBINAR_LINK } from "constants/paths";

const SquareIllustrate = (props: any) => {
return (
Expand All @@ -37,6 +40,11 @@ const Hero = () => {
const variantTitle = useBreakpointValue({ base: "mobile-h1", lg: "h1" });
const variantSubtitle = useBreakpointValue({ base: "md", lg: "lg" });

const pressButton = (link: any, type:string) =>{
let event = type === 'webinar' ? SPLITBEE_EVENTS_NAME.REGISTER_WEBINAR : SPLITBEE_EVENTS_NAME.SUPPORT_US;
splitbee.track(`${event}`, {link})
}

return (
<Box w="full" position="relative" as="section" id="hero">
<Box
Expand Down Expand Up @@ -87,12 +95,13 @@ const Hero = () => {
Pop Culture, dan Sains.
</Text>
<HStack spacing="24px" mt="32px" d={{ base: "none", lg: "flex" }}>
<Link isExternal href="https://lynk.id/logos_id">
<Button variant="primary" size="md" fontWeight="semibold">

<Link isExternal href={WEBINAR_LINK}>
<Button variant="primary" size="md" fontWeight="semibold" onClick={()=>pressButton(WEBINAR_LINK, 'webinar')}>
Daftar Webinar
</Button>
</Link>
<Link isExternal href="https://karyakarsa.com/logos_id">
<Link isExternal href={SUPPORT_LINK}>
<Button
variant="outline"
borderColor="white"
Expand All @@ -103,6 +112,7 @@ const Hero = () => {
borderColor: "blue.700",
bg: "blue.700",
}}
onClick={()=>{pressButton(SUPPORT_LINK, 'support')}}
>
Support Us
</Button>
Expand Down
6 changes: 5 additions & 1 deletion src/components/homepage/Webinar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import {
} from "@chakra-ui/react";
import Image from "next/image";
import ImageWebinar from "@/public/img/image-webinar.png";
import splitbee from "@splitbee/web";
import { SPLITBEE_EVENTS_NAME } from "constants/eventSplitbee";
import { WEBINAR_LINK } from "constants/paths";

export default function Webinar() {
const variantTitle = useBreakpointValue({ base: "mobile-h3", lg: "h3" });
Expand All @@ -22,6 +25,7 @@ export default function Webinar() {
lg: "lg",
});
const variantSizeButton = useBreakpointValue({ base: "xs", sm: "md" });

return (
<Container mb="20" mt={{ base: "50px", lg: "0" }} as="section" id="webinar">
<Grid
Expand Down Expand Up @@ -68,7 +72,7 @@ export default function Webinar() {
</Text>
</VStack>
<Link href="https://lynk.id/logos_id" role="link" isExternal>
<Button variant="primary" size={variantSizeButton}>
<Button variant="primary" size={variantSizeButton} onClick={()=> splitbee.track(SPLITBEE_EVENTS_NAME.REGISTER_WEBINAR, {link: WEBINAR_LINK})}>
Daftar Webinar
</Button>
</Link>
Expand Down
3 changes: 1 addition & 2 deletions src/components/icons/Instagram.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Icon } from "@chakra-ui/react";

const Instagram = (props: any) => {
export const Instagram = (props: any) => {
return (
<Icon
viewBox="0 0 64 64"
Expand All @@ -20,4 +20,3 @@ const Instagram = (props: any) => {
);
};

export default Instagram;
3 changes: 1 addition & 2 deletions src/components/icons/Spotify.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Icon } from "@chakra-ui/react";

const Spotify = (props: any) => {
export const Spotify = (props: any) => {
return (
<Icon
viewBox="0 0 64 64"
Expand All @@ -16,4 +16,3 @@ const Spotify = (props: any) => {
);
};

export default Spotify;
3 changes: 1 addition & 2 deletions src/components/icons/Twitter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Icon } from "@chakra-ui/react";

const Twitter = (props: any) => {
export const Twitter = (props: any) => {
return (
<Icon
viewBox="0 0 62 50"
Expand All @@ -16,4 +16,3 @@ const Twitter = (props: any) => {
);
};

export default Twitter;
3 changes: 1 addition & 2 deletions src/components/icons/Youtube.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Icon } from "@chakra-ui/react";

const Youtube = (props: any) => {
export const Youtube = (props: any) => {
return (
<Icon
viewBox="0 0 92 64"
Expand All @@ -16,4 +16,3 @@ const Youtube = (props: any) => {
);
};

export default Youtube;
4 changes: 4 additions & 0 deletions src/components/icons/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { Instagram } from './Instagram';
export { Spotify } from './Spotify';
export { Twitter } from './Twitter';
export { Youtube } from './Youtube';
10 changes: 7 additions & 3 deletions src/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import {
Button,
Link,
} from "@chakra-ui/react";
import splitbee from "@splitbee/web";
import { SPLITBEE_EVENTS_NAME } from "constants/eventSplitbee";
import { LOGOS_LINK, MICROSITE_GITHUB_LINK } from '../../constants/paths';

const Footer = () => {
return (
Expand All @@ -31,8 +34,8 @@ const Footer = () => {
Please contact us through this button below.
</Text>
<HStack spacing="24px" mt="32px">
<Link role="link" href="https://logosid.xyz" isExternal>
<Button variant="primary">Visit Our Website</Button>
<Link role="link" href={LOGOS_LINK} isExternal>
<Button onClick={()=> splitbee.track(SPLITBEE_EVENTS_NAME.ARTICLES_LOGOS, {link: LOGOS_LINK})} variant="primary">Visit Our Website</Button>
</Link>
</HStack>
</GridItem>
Expand All @@ -44,9 +47,10 @@ const Footer = () => {
&copy; 2021. Made with ❤ by
</Text>
<Link
href="https://github.com/logos-engineer/microsite-logos"
href={MICROSITE_GITHUB_LINK}
isExternal
role="link"
onClick={()=> splitbee.track(SPLITBEE_EVENTS_NAME.EXTERNAL_LINK, {link: MICROSITE_GITHUB_LINK})}
>
<Text variant="lg" color="white">
Logos Engineer
Expand Down
24 changes: 24 additions & 0 deletions src/constants/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { INSTAGRAM_LINK, SPOTIFY_LINK, TWITTER_LINK, YOUTUBE_LINK } from "./paths";

export const SOCIAL_MEDIA = [
{
id: 1,
label: 'instagram',
link: INSTAGRAM_LINK,
},
{
id: 2,
label: 'spotify',
link: SPOTIFY_LINK,
},
{
id: 3,
label: 'twitter',
link: TWITTER_LINK,
},
{
id: 4,
label: 'youtube',
link: YOUTUBE_LINK,
}
]
6 changes: 6 additions & 0 deletions src/constants/eventSplitbee.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const SPLITBEE_EVENTS_NAME: any = {
REGISTER_WEBINAR: 'register_webinar',
SUPPORT_US: 'support_us',
ARTICLES_LOGOS: 'articles_logos_website',
EXTERNAL_LINK: 'external_link',
};
9 changes: 9 additions & 0 deletions src/constants/paths.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
export const HOME: string = `https://microsite-logos.vercel.app`;
export const META_IMAGE: string = `/img/meta-small.png`;
export const WEBINAR_LINK: any = `https://lynk.id/logos_id`;
export const SUPPORT_LINK: any = `https://karyakarsa.com/logos_id`;
export const LOGOS_LINK: any = `https://logosid.xyz`;
export const MICROSITE_GITHUB_LINK: any = `https://github.com/logos-engineer/microsite-logos`;
export const INSTAGRAM_LINK: any = `https://instagram.com/_logosid`;
export const SPOTIFY_LINK: any = `https://open.spotify.com/show/2bwe0dyWnFKmqXaYCSwhML?si=VflhXjXRQqCL0VTVTO2_Zw&nd=1`;
export const TWITTER_LINK: any = `https://twitter.com/logos_id`;
export const YOUTUBE_LINK: any = `https://www.youtube.com/channel/UCh3AnUWH0gaiRi-ibilRj2Q`;

13 changes: 13 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useEffect } from "react";
import splitbee from "@splitbee/web";
import Hero from "@/components/homepage/Hero";
import Webinar from "@/components/homepage/Webinar";
import Article from "@/components/homepage/Article/Article";
Expand All @@ -6,6 +8,17 @@ import FollowUs from "@/components/homepage/FollowUs";
import Cta from "@/components/homepage/Cta";

const Home = () => {

useEffect((): void => {
splitbee.init({
token: 'M6FJO0PCQR94',
disableCookie: false,
scriptUrl: "https://cdn.splitbee.io/sb.js",
apiUrl: "https://hive.splitbee.io",
})

}, []);

return (
<Layout>
<Hero />
Expand Down
Loading