-
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.
Merge branch 'main' of https://github.com/The-Cowboys/the-cowboy-day …
…into Cambios-TontoDelDia
- Loading branch information
Showing
13 changed files
with
643 additions
and
188 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: 🚢 Publicar a GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ci-deploy-pages-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
publish: | ||
defaults: | ||
run: | ||
working-directory: ${{ github.workspace }}/frontend | ||
name: Publicar a GitHub Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.5.1 | ||
cache: 'npm' | ||
- run: pwd | ||
- run: rm -rf dist | ||
- run: git branch | ||
- run: ls -l | ||
- run: npm install | ||
- run: npm run 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
Large diffs are not rendered by default.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { useState } from 'react'; | ||
|
||
const Inicio = () => { | ||
const [cowboy, setCowboy] = useState(null); | ||
const [clicked, setClick] = useState(false); | ||
|
||
const click = () => { | ||
setClick(true); | ||
|
||
setTimeout(() => { | ||
fetchCowboys(); | ||
}, 1000); | ||
}; | ||
|
||
const fetchCowboys = async () => { | ||
try { | ||
const response = await fetch('https://thecowboys.duckdns.org/api/cowboys/today'); | ||
const data = await response.json(); | ||
setCowboy(data.name); | ||
} catch (error) { | ||
console.error('Error fetching data:', error); | ||
} | ||
}; | ||
|
||
return ( | ||
<div className="cowboyDelDia"> | ||
{ | ||
!clicked ? ( | ||
<button className='btn btn-dark' onClick={click}> | ||
¿Quien es el Cowboy del día? | ||
</button> | ||
) : ( | ||
<div> | ||
<p>El cowboy de hoy es....</p> | ||
<h2>{cowboy}</h2> | ||
</div> | ||
) | ||
} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Inicio; |
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 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 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 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,11 @@ | ||
ALTER TABLE cowboys ADD COLUMN email varchar UNIQUE; | ||
|
||
UPDATE cowboys SET email = '[email protected]' where id = 4; | ||
UPDATE cowboys SET email = '[email protected]' where id = 3; | ||
UPDATE cowboys SET email = '[email protected]' where id = 5; | ||
UPDATE cowboys SET email = '[email protected]' where id = 6; | ||
UPDATE cowboys SET email = '[email protected]' where id = 2; | ||
UPDATE cowboys SET email = '[email protected]' where id = 1; | ||
|
||
-- make email not null | ||
ALTER TABLE cowboys ALTER COLUMN email SET NOT NULL; |