diff --git a/cmd/cleangcp/main.go b/cmd/cleangcp/main.go deleted file mode 100644 index 3ca0ee5..0000000 --- a/cmd/cleangcp/main.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import ( - "log" - "os" -) - -func main() { - projectName := os.Getenv("GOOGLE_PROJECT_NAME") - if len(projectName) < 1 { - log.Fatalf("GOOGLE_PROJECT_NAME ıs required") - } - -} diff --git a/web/app/src/pages/HomePage.tsx b/web/app/src/pages/HomePage.tsx index 0906dac..2d29fc5 100644 --- a/web/app/src/pages/HomePage.tsx +++ b/web/app/src/pages/HomePage.tsx @@ -1,95 +1,104 @@ import {FormEvent, useState} from "react"; import './HomePage.css'; import {gql, useMutation} from "@apollo/client"; -import {Navigate} from "react-router-dom"; +import {Link, Navigate} from "react-router-dom"; import {Helmet} from "react-helmet"; import {WEB_BASE_URL} from "../Constants"; import {Capture, CaptureVariables} from "./__generated__/Capture"; const CAPTURE_TWEET = gql` - mutation Capture($url:String!) { - capture(url:$url) { - id - fullText - favoriteCount - retweetCount - postedAt - author { - userName - screenName - profileImageURL - } + mutation Capture($url:String!) { + capture(url:$url) { + id + fullText + favoriteCount + retweetCount + postedAt + author { + userName + screenName + profileImageURL + } + } } - } `; const HomePage = () => { - const [url, setUrl] = useState(''); - const [validation, setValidation] = useState(''); + const [url, setUrl] = useState(''); + const [validation, setValidation] = useState(''); + + const [doQuery, {data, loading, error}] = useMutation(CAPTURE_TWEET) - const [doQuery, {data, loading, error}] = useMutation(CAPTURE_TWEET) + const handleSummit = async (e: FormEvent) => { + e.preventDefault(); + setValidation(''); + if (url.length <= 5 || !url.startsWith("http")) { + setValidation("Please enter a valid URL. Example: https://twitter.com/jack/status/20"); + } else { + try { + await doQuery({ + variables: {url: url} + }); + } catch (ex: unknown) { + if (ex instanceof Error) { + console.log(ex.toString()); + } - const handleSummit = async (e: FormEvent) => { - e.preventDefault(); - setValidation(''); - if (url.length <= 5 || !url.startsWith("http")) { - setValidation("Please enter a valid URL. Example: https://twitter.com/jack/status/20"); - } else { - try { - await doQuery({ - variables: {url: url} - }); - } catch (ex:unknown) { - if ( ex instanceof Error) { - console.log(ex.toString()); + } } - - } } - } - if (data && data.capture && data.capture.id.length > 0) { - return - } + if (data && data.capture && data.capture.id.length > 0) { + return + } - return ( - <> - - - - - Capture Tweet | Home - -
-
-

Enter a twitter URL and click CAPTURE button

- {error &&
-

{error.message}

-
- } - {validation.length > 0 &&
-

{validation}

- + return ( + <> + + + + + Capture Tweet | Home + +
+
+ +

+
Sunsetting: capturetweet is currently readonly.
+ capturetweet.com will be shut down on 31.12.2023. if you need anything please contact us. +
+

Enter a twitter URL and click CAPTURE button

+ {error &&
+

{error.message}

+
+ } + {validation.length > 0 && +
+

{validation}

+ +
+ } +
+ +
+ setUrl(event.target.value)}/> + {loading ? + : + + } +
+
- } -
- -
- setUrl(event.target.value)}/> - {loading ? - : - - } -
-
-
- - ) + + ) };