mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-11-21 12:37:20 +01:00
i run patch on main, checked out this branch, run prettier format, and then run diff
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
--- template/app/src/client/components/RepoInfo.tsx
|
||||
+++ opensaas-sh/app/src/client/components/RepoInfo.tsx
|
||||
@@ -0,0 +1,40 @@
|
||||
+import { useEffect, useState } from 'react';
|
||||
+import { FaGithub } from 'react-icons/fa';
|
||||
+import { Button } from '../../components/ui/button';
|
||||
+import { formatNumber } from '../../lib/utils';
|
||||
@@ -0,0 +1,48 @@
|
||||
+import { useEffect, useState } from "react";
|
||||
+import { FaGithub } from "react-icons/fa";
|
||||
+import { Button } from "../../components/ui/button";
|
||||
+import { formatNumber } from "../../lib/utils";
|
||||
+
|
||||
+const RepoInfo = () => {
|
||||
+ const [repoInfo, setRepoInfo] = useState<null | any>(null);
|
||||
@@ -14,11 +14,13 @@
|
||||
+ const fetchRepoInfo = async () => {
|
||||
+ try {
|
||||
+ setIsLoading(true);
|
||||
+ const response = await fetch('https://api.github.com/repos/wasp-lang/open-saas');
|
||||
+ const response = await fetch(
|
||||
+ "https://api.github.com/repos/wasp-lang/open-saas",
|
||||
+ );
|
||||
+ const data = await response.json();
|
||||
+ setRepoInfo(data);
|
||||
+ } catch (error) {
|
||||
+ console.error('Error fetching repo info', error);
|
||||
+ console.error("Error fetching repo info", error);
|
||||
+ } finally {
|
||||
+ setIsLoading(false);
|
||||
+ }
|
||||
@@ -31,10 +33,16 @@
|
||||
+ }
|
||||
+
|
||||
+ return (
|
||||
+ <a href='https://github.com/wasp-lang/open-saas' target='_blank' rel='noopener noreferrer'>
|
||||
+ <Button variant='ghost' className='rounded-full py-0 pl-2 pr-3 h-8'>
|
||||
+ <a
|
||||
+ href="https://github.com/wasp-lang/open-saas"
|
||||
+ target="_blank"
|
||||
+ rel="noopener noreferrer"
|
||||
+ >
|
||||
+ <Button variant="ghost" className="h-8 rounded-full py-0 pl-2 pr-3">
|
||||
+ <FaGithub />
|
||||
+ <span className='text-sm leading-none'>{formatNumber(repoInfo.stargazers_count)}</span>
|
||||
+ <span className="text-sm leading-none">
|
||||
+ {formatNumber(repoInfo.stargazers_count)}
|
||||
+ </span>
|
||||
+ </Button>
|
||||
+ </a>
|
||||
+ );
|
||||
|
||||
Reference in New Issue
Block a user