Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.
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
2 changes: 1 addition & 1 deletion components/ClipboardCopy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import { useState } from "react";
import { onlyText } from "react-children-utilities";

const ClipboardCopy = ({ children }) => {
Expand Down
2 changes: 1 addition & 1 deletion components/Footer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Link from "../components/Link";
import Link from "@components/Link";
import getIcon from "./Icon";
const FaMoneyBillAlt = getIcon("FaMoneyBillAlt");
const FaRocket = getIcon("FaRocket");
Expand Down
2 changes: 1 addition & 1 deletion components/IconCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Fragment, useState } from 'react'
import { Transition } from '@headlessui/react'
import { CheckCircleIcon } from '@heroicons/react/24/outline'
import { XMarkIcon } from '@heroicons/react/20/solid'
import getIcon from "../components/Icon";
import getIcon from "@components/Icon";

export default function IconCard({ iconName }) {
const [show, setShow] = useState(false)
Expand Down
1 change: 0 additions & 1 deletion components/Link.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import NextLink from "next/link";

export default function Link({ children, className, rel, ...restProps }) {
Expand Down
8 changes: 6 additions & 2 deletions components/Tag.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { abbreviateNumber } from "../services/utils/abbreviateNumbers";
import { abbreviateNumber } from "@services/utils/abbreviateNumbers";
import Badge from "./Badge";

export default function Tag({ name, total, selected, onClick }) {
return (
<Badge content={abbreviateNumber(total)} display={!!total} badgeClassName={"translate-x-2/4 -translate-y-1/2"}>
<Badge
content={abbreviateNumber(total)}
display={!!total}
badgeClassName={"translate-x-2/4 -translate-y-1/2"}
>
<div
onClick={onClick}
className={`flex flex-row p-1 m-2 rounded-lg text-sm font-mono border-2 cursor-pointer shadow-none ${
Expand Down
1 change: 0 additions & 1 deletion components/Testimonials.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Image from "next/image";
import Link from "./Link";

export default function Testimonials({ data }) {
Expand Down
4 changes: 2 additions & 2 deletions components/event/EventCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
} from "react-icons/md";
import { ReactMarkdown } from "react-markdown/lib/react-markdown";

import Link from "../Link";
import FallbackImage from "../FallbackImage";
import Link from "@components/Link";
import FallbackImage from "@components/FallbackImage";

export default function EventCard({ event, username }) {
const fallbackImageSize = 60;
Expand Down
2 changes: 1 addition & 1 deletion components/event/EventTabs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Link from "../Link";
import Link from "@components/Link";

export function EventTabs({ tabs, eventType, setEventType }) {
const classNames = (...classes) => classes.filter(Boolean).join(" ");
Expand Down
6 changes: 3 additions & 3 deletions components/layouts/DocsLayout.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { MDXProvider } from "@mdx-js/react";
import Head from "next/head";

import Page from "../Page";
import Link from "../../components/Link";
import { ComponentStyle } from "../mdx/ComponentStyle";
import Page from "@components/Page";
import Link from "@components/Link";
import { ComponentStyle } from "@components/mdx/ComponentStyle";

export default function DocsLayout({ children, title }) {
return (
Expand Down
4 changes: 2 additions & 2 deletions components/layouts/MultiLayout.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Script from "next/script";

import Navbar from "../navbar/Navbar";
import Footer from "../Footer";
import Navbar from "@components/navbar/Navbar";
import Footer from "@components/Footer";

export default function MultiLayout({ children }) {
return (
Expand Down
2 changes: 1 addition & 1 deletion components/layouts/SingleLayout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Footer from "../Footer";
import Footer from "@components/Footer";

export default function SingleLayout({ children }) {
return (
Expand Down
95 changes: 48 additions & 47 deletions components/map/Map.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,58 @@
import React from "react";
import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";
import { ReactMarkdown } from "react-markdown/lib/react-markdown";
import "leaflet/dist/leaflet.css";

import Link from "../Link";
import MarkerCluster from "./MarkerCluster";
import { ReactMarkdown } from "react-markdown/lib/react-markdown";
import Link from "@components/Link";
import MarkerCluster from "@components/map/MarkerCluster";

export default function Map({ users }) {
return (
<>
<MapContainer
style={{ height: "100vh", width: "width: 100vw", zIndex: 10 }}
center={[16.843908, -18.09]}
zoom={2}
zoomControl={true}
scrollWheelZoom={false}
maxBounds={null}
>
<TileLayer
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<MarkerCluster>
{users.map((user) => (
<div key={user.username}>
<Marker
icon={L.icon({
className: "rounded-full",
iconUrl: `https://github.com/${user.username}.png`,
popupAnchor: [0, -10],
iconSize: [40, 40],
iconAnchor: [20, 20],
})}
position={[user.location.lat, user.location.lon]}
>
<Popup>
<div className="flex flex-col gap-[5px]">
<h1 className="font-[600]">
<Link
href={`https://linkfree.eddiehub.io/${user.username}`}
>
{user.name}
</Link>
</h1>
<span>{user.location.provided}</span>
<span><ReactMarkdown>{user.bio}</ReactMarkdown></span>
</div>
</Popup>
</Marker>
</div>
))}
</MarkerCluster>
</MapContainer>
<MapContainer
style={{ height: "100vh", width: "width: 100vw", zIndex: 10 }}
center={[16.843908, -18.09]}
zoom={2}
zoomControl={true}
scrollWheelZoom={false}
maxBounds={null}
>
<TileLayer
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<MarkerCluster>
{users.map((user) => (
<div key={user.username}>
<Marker
icon={L.icon({
className: "rounded-full",
iconUrl: `https://github.com/${user.username}.png`,
popupAnchor: [0, -10],
iconSize: [40, 40],
iconAnchor: [20, 20],
})}
position={[user.location.lat, user.location.lon]}
>
<Popup>
<div className="flex flex-col gap-[5px]">
<h1 className="font-[600]">
<Link
href={`https://linkfree.eddiehub.io/${user.username}`}
>
{user.name}
</Link>
</h1>
<span>{user.location.provided}</span>
<span>
<ReactMarkdown>{user.bio}</ReactMarkdown>
</span>
</div>
</Popup>
</Marker>
</div>
))}
</MarkerCluster>
</MapContainer>
</>
);
}
2 changes: 1 addition & 1 deletion components/modals/ProfilePreview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import UserPage from "../user/UserPage";
import UserPage from "@components/user/UserPage";

export default function Preview({ toggle, data }) {
const BASE_URL = process.env.NEXT_PUBLIC_BASE_URL;
Expand Down
2 changes: 1 addition & 1 deletion components/navbar/NavLink.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Link from "../Link";
import Link from "@components/Link";

export default function NavLink({ path, item, mode, setIsOpen, onClick }) {
let className =
Expand Down
16 changes: 9 additions & 7 deletions components/navbar/Navbar.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { useRouter } from "next/router";
import { useEffect, useRef, useState } from "react";
import { useSession, signIn, signOut } from "next-auth/react";

import NavLink from "./NavLink";
import Link from "../Link";
import app from "../../config/app.json";
import Image from "next/legacy/image";
import getIcon from "../Icon";

import app from "@config/app.json";
import NavLink from "@components/navbar/NavLink";
import Link from "@components/Link";
import getIcon from "@components/Icon";

const FaGithub = getIcon("FaGithub");

export default function Navbar() {
Expand Down Expand Up @@ -179,10 +180,11 @@ export default function Navbar() {
</div>

<div
className={`${isOpen
className={`${
isOpen
? "transform translate-y-0 opacity-100"
: "transform -translate-y-96 opacity-0 "
} md:hidden z-20 absolute t-0 bg-gray-800 transition-all duration-700 ease-in-out w-full`}
} md:hidden z-20 absolute t-0 bg-gray-800 transition-all duration-700 ease-in-out w-full`}
id="mobile-menu"
>
<div className="px-2 pt-2 pb-3 space-y-1 sm:px-3">
Expand Down
3 changes: 2 additions & 1 deletion components/statistics/BasicCards.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { abbreviateNumber } from "../../services/utils/abbreviateNumbers";
import { MdArrowUpward } from "react-icons/md";

import { abbreviateNumber } from "@services/utils/abbreviateNumbers";

export default function BasicCards({ data }) {
return (
<dl className="mt-5 grid grid-cols-1 gap-5 sm:grid-cols-3">
Expand Down
6 changes: 3 additions & 3 deletions components/user/UserCard.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Link from "../Link";
import ReactMarkdown from "react-markdown";
import { abbreviateNumber } from "../../services/utils/abbreviateNumbers";
import FallbackImage from "../FallbackImage";

import Link from "@components/Link";
import FallbackImage from "@components/FallbackImage";

export default function UserCard({ profile }) {
return (
Expand Down
6 changes: 3 additions & 3 deletions components/user/UserEvents.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useState } from "react";

import EventCard from "../event/EventCard";
import Alert from "../Alert";
import EventKey from "../event/EventKey";
import EventCard from "@components/event/EventCard";
import Alert from "@components/Alert";
import EventKey from "@components/event/EventKey";

export default function UserEvents({ data }) {
const [eventType, seteventType] = useState("future");
Expand Down
6 changes: 3 additions & 3 deletions components/user/UserLink.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useState } from "react";

import getIcon from "../Icon";
import colors from "../../config/icons.json";
import Link from "../Link";
import getIcon from "@components/Icon";
import colors from "@config/icons.json";
import Link from "@components/Link";

export default function UserLink({ BASE_URL, link, username }) {
const [clicks, setClicks] = useState(link.clicks || 0);
Expand Down
2 changes: 1 addition & 1 deletion components/user/UserLinks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import UserLink from "./UserLink";
import Alert from "../Alert";
import Alert from "@components/Alert";

export default function UserLinks({ BASE_URL, data }) {
const defaultBucket = "Others";
Expand Down
4 changes: 2 additions & 2 deletions components/user/UserMilestone.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ReactMarkdown } from "react-markdown/lib/react-markdown";
import { FaExternalLinkAlt } from "react-icons/fa";

import getIcon from "../Icon";
import Link from "../Link";
import getIcon from "@components/Icon";
import Link from "@components/Link";

export default function UserMilestone({ milestone, isGoal }) {
const DisplayIcon = getIcon(milestone.icon);
Expand Down
2 changes: 1 addition & 1 deletion components/user/UserMilestones.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import UserMilestone from "./UserMilestone";
import Alert from "../Alert";
import Alert from "@components/Alert";

export default function UserMilestones({ data }) {
const historicMilestones = data.milestones.filter(
Expand Down
13 changes: 8 additions & 5 deletions components/user/UserProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import ReactMarkdown from "react-markdown";
import { MdQrCode2 } from "react-icons/md";
import { QRCodeSVG } from "qrcode.react";

import FallbackImage from "../FallbackImage";
import FallbackImage from "@components/FallbackImage";
import UserSocial from "./UserSocials";
import Tag from "../Tag";
import Link from "../Link";
import Badge from "../Badge";
import Tag from "@components/Tag";
import Link from "@components/Link";
import Badge from "@components/Badge";

function UserProfile({ BASE_URL, data }) {
const [qrShow, setQrShow] = useState(false);
Expand Down Expand Up @@ -68,7 +68,10 @@ function UserProfile({ BASE_URL, data }) {

<div className="flex justify-center my-4">
{qrShow && (
<QRCodeSVG value={`${BASE_URL}/${data.username}`} size={fallbackImageSize * 2} />
<QRCodeSVG
value={`${BASE_URL}/${data.username}`}
size={fallbackImageSize * 2}
/>
)}
</div>
</>
Expand Down
4 changes: 2 additions & 2 deletions components/user/UserSocials.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import getIcon from "../Icon";
import Link from "../Link";
import getIcon from "@components/Icon";
import Link from "@components/Link";

function UserSocial({ BASE_URL, username, social }) {
const DisplayIcon = getIcon(social.icon);
Expand Down
3 changes: 2 additions & 1 deletion components/user/UserTabs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BiSortAlt2 } from "react-icons/bi";
import Link from "../Link";

import Link from "@components/Link";

export default function UserTabs({ tabs, setTabs, setUserData, userData }) {
const classNames = (...classes) => classes.filter(Boolean).join(" ");
Expand Down
7 changes: 4 additions & 3 deletions components/user/UserTestimonials.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Link from "../Link";
import Alert from "../Alert";
import FallbackImage from "../FallbackImage";
import { ReactMarkdown } from "react-markdown/lib/react-markdown";

import Link from "@components/Link";
import Alert from "@components/Alert";
import FallbackImage from "@components/FallbackImage";

export default function UserTestimonials({ data }) {
return (
<>
Expand Down
19 changes: 19 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@components/*": [
"components/*"
],
"@config/*": [
"config/*"
],
"@services/*": [
"services/*"
],
"@models/*": [
"models/*"
]
}
}
}
Loading