-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial next commit * landing page good enough for now * strava oauth done, exchange code next * integrating with lambda * delete next crap * test deploy * add local db fix
- Loading branch information
Showing
17 changed files
with
437 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ name: Deploy to Lambda | |
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import os | ||
from typing import List | ||
|
||
import pyperclip | ||
|
||
|
||
def get_code_files(directory: str, extensions: List[str]) -> List[str]: | ||
""" | ||
Recursively finds all code files in the given directory with specified extensions, | ||
strictly ignoring any path containing 'node_modules'. | ||
:param directory: Directory to search for code files. | ||
:param extensions: List of file extensions to include. | ||
:return: List of file paths for code files. | ||
""" | ||
code_files = [] | ||
for root, _, files in os.walk(directory): | ||
if "node_modules" in root or ".next" in root: | ||
continue | ||
|
||
code_files.extend( | ||
os.path.join(root, file) | ||
for file in files | ||
if any(file.endswith(ext) for ext in extensions) | ||
) | ||
return code_files | ||
|
||
|
||
def read_files(file_paths: List[str], directory: str) -> str: | ||
""" | ||
Reads the content of the given files and returns a combined string. | ||
:param file_paths: List of file paths to read. | ||
:param directory: Base directory for calculating relative paths. | ||
:return: Combined content of all files as a string. | ||
""" | ||
content = [] | ||
for file_path in file_paths: | ||
with open(file_path, "r") as file: | ||
relative_path = os.path.relpath(file_path, directory) | ||
content.append(f"--- {relative_path} ---\n") | ||
content.append(file.read()) | ||
content.append("\n\n") | ||
return "".join(content) | ||
|
||
|
||
def copy_code_to_clipboard() -> None: | ||
""" | ||
Copies all code files from the current working directory to the clipboard. | ||
""" | ||
extensions = [ | ||
".py", | ||
".js", | ||
".ts", | ||
".html", | ||
".css", | ||
".tsx", | ||
".jsx", | ||
] | ||
directory = os.getcwd() | ||
code_files = get_code_files(directory, extensions) | ||
combined_content = read_files(code_files, directory) | ||
pyperclip.copy(combined_content) | ||
|
||
|
||
if __name__ == "__main__": | ||
copy_code_to_clipboard() | ||
print("Code files have been copied to the clipboard.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Image from 'next/image'; | ||
|
||
const Footer = (): JSX.Element => { | ||
return ( | ||
<footer className="mt-32 w-full bg-gray-100 text-gray-400 py-4"> | ||
<div className="container flex items-center justify-between"> | ||
<Image | ||
src="/powered_by_strava.png" | ||
alt="Powered by Strava" | ||
width={162} | ||
height={30} | ||
className="ml-4" | ||
/> | ||
<p className="text-center flex-grow"> | ||
© 2024 TrackFlow. All rights reserved. | ||
</p> | ||
</div> | ||
</footer> | ||
); | ||
}; | ||
|
||
export default Footer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
import { useState } from 'react'; | ||
import SignUp from './SignUp'; | ||
|
||
export default function Navbar(): JSX.Element { | ||
const [showSignup, setShowSignup] = useState(false); | ||
|
||
return ( | ||
<> | ||
<nav className="fixed top-0 w-full bg-opacity-0 text-gray-700 z-10"> | ||
<div className="px-6"> | ||
<div className="flex justify-between h-16"> | ||
<div className="flex-shrink-0 flex items-center"> | ||
<Link href="/" className="text-2xl font-bold hover:text-gray-500 transition duration-300 ease-in-out"> | ||
TrackFlow | ||
</Link> | ||
</div> | ||
<div className="flex items-center"> | ||
<button className="text-xl px-6 py-2 rounded-lg hover:bg-white transition duration-300 ease-in-out" | ||
onClick={() => setShowSignup(true)}> | ||
<div className="flex items-center"> | ||
<Image | ||
src="/strava-icon.png" | ||
alt="Strava Logo" | ||
width={20} | ||
height={20} | ||
className="mr-2" | ||
/> | ||
Sign Up | ||
</div> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</nav> | ||
{showSignup && <SignUp onClose={() => setShowSignup(false)} />} | ||
</> | ||
); | ||
} |
Oops, something went wrong.