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

Add "submit on Github" on project page #207

Merged
merged 7 commits into from
Feb 24, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Improvements

- [#207](https://github.com/alleslabs/celatone-frontend/pull/207) Add cta to submit public project in list page
- [#204](https://github.com/alleslabs/celatone-frontend/pull/204) Change back button wording and adjust flow
- [#191](https://github.com/alleslabs/celatone-frontend/pull/191) Add typeface (Poppins) and add new styling for command shortcut
- [#190](https://github.com/alleslabs/celatone-frontend/pull/190) Setup sentry tunnel in next config
Expand Down
43 changes: 36 additions & 7 deletions src/lib/pages/public-project/components/AllProject.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { Box, SimpleGrid, Flex, Button, Icon } from "@chakra-ui/react";
import {
Box,
SimpleGrid,
Flex,
Button,
Icon,
Link,
Text,
} from "@chakra-ui/react";
import { matchSorter } from "match-sorter";
import { observer } from "mobx-react-lite";
import { useMemo, useState } from "react";
Expand All @@ -8,6 +16,7 @@ import { TextInput } from "lib/components/forms";
import { Loading } from "lib/components/Loading";
import { EmptyState } from "lib/components/state/EmptyState";
import { usePublicProjectStore } from "lib/hooks";
import { AmpEvent, AmpTrack } from "lib/services/amplitude";
import { usePublicProjects } from "lib/services/publicProjectService";
import type { PublicProjectInfo } from "lib/types";

Expand Down Expand Up @@ -43,17 +52,24 @@ export const AllProject = observer(() => {
}, [publicProjectInfo, savedProjects, searchKeyword]);

if (isLoading) return <Loading />;
if (!publicProjectInfo)
if (publicProjectInfo)
return (
<Flex flexDirection="column" alignItems="center">
<EmptyState
image="https://assets.alleslabs.dev/illustration/search-empty.svg"
message="We are currently gathering public projects to feature here. If you would like to share your project with the community, please submit your request."
/>
<Button gap={2} mt={8}>
<Icon as={BsGithub} />
Submit on Github
</Button>
<Link
href="https://github.com/alleslabs/celatone-api"
target="_blank"
rel="noopener noreferrer"
onClick={() => AmpTrack(AmpEvent.USE_SUBMIT_PROJECT)}
>
<Button gap={2} mt={8}>
<Icon as={BsGithub} />
Submit on Github
</Button>
</Link>
</Flex>
);

Expand All @@ -74,7 +90,7 @@ export const AllProject = observer(() => {
image="https://assets.alleslabs.dev/illustration/search-not-found.svg"
/>
) : (
<SimpleGrid columns={{ sm: 1, md: 3, xl: 4 }} spacing={4} w="full">
<SimpleGrid columns={{ sm: 1, md: 3 }} spacing={4} w="full">
{filteredPublicProjects.map((item) => (
<PublicProjectCard
key={item.slug}
Expand All @@ -84,6 +100,19 @@ export const AllProject = observer(() => {
))}
</SimpleGrid>
)}
<Flex justifyContent="center" gap="2" w="100%" mt="64px">
<Text color="text.dark" variant="body2">
Want your project here?
</Text>
<Link
href="https://github.com/alleslabs/celatone-api"
target="_blank"
rel="noopener noreferrer"
onClick={() => AmpTrack(AmpEvent.USE_SUBMIT_PROJECT)}
>
Submit on Github
</Link>
</Flex>
</Box>
);
});
8 changes: 7 additions & 1 deletion src/lib/pages/public-project/components/SocialMedia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ export const SocialMedia = ({ details }: SocialMediaProps) => {
onClick={() => AmpTrackWebsite(details.website)}
/>
)}
{details.github && <IconButton href={details.github} icon={FaGithub} />}
{details.github && (
<IconButton
href={details.github}
icon={FaGithub}
onClick={() => AmpTrackSocial(details.github)}
/>
)}
{details.socials.length &&
details.socials.map(
(social) =>
Expand Down
1 change: 1 addition & 0 deletions src/lib/services/amplitude.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export enum AmpEvent {
USE_QUICK_EDIT_CONTRACT = "Use Quick Edit Contract",
USE_QUICK_EDIT_CODE = "Use Quick Edit Code",
USE_OTHER_MODAL = "Use Other Modal",
USE_SUBMIT_PROJECT = "Use Submit Project",
// TX
TX_SUCCEED = "Tx Succeed",
TX_FAILED = "Tx Failed",
Expand Down