-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* oauth first pass with templates * Add hot reload * Update auth flow and add section highlighter * Add remove and re order * Code cleanup * Fix typo * WIP * Authentication refactor: Contentful custom hook and more (#75) * updates to improve UX for auth flow * better messaging when updating environment (#76) * fixing some issues around templates * removed unnecessary code block --------- Co-authored-by: Brad Taylor <[email protected]> Co-authored-by: Jaime Morales <[email protected]>
- Loading branch information
1 parent
f234ff2
commit 95d8836
Showing
38 changed files
with
1,602 additions
and
11,253 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
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
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 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Contentful Sidekick Oauth Redirect</title> | ||
</head> | ||
<body> | ||
<div>Redirecting...</div> | ||
<script type="text/javascript" src="/js/oauth_redirect.js"></script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,29 @@ | ||
.banner { | ||
position: fixed; | ||
top: -50px; | ||
left: 0; | ||
right: 0; | ||
height: 50px; | ||
background-color: #9146ff; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 0 20px; | ||
color: white; | ||
font-weight: bold; | ||
font-size: 12px; | ||
transition: top 0.5s ease; | ||
z-index: 10000; | ||
} | ||
|
||
.banner.show { | ||
top: 0; | ||
} | ||
|
||
.banner button { | ||
background-color: transparent; | ||
color: white; | ||
border: none; | ||
font-size: 20px; | ||
cursor: pointer; | ||
} |
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 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import './Banner.css'; | ||
import { useContentfulContext } from '../../helpers/ContentfulContext'; | ||
|
||
const Banner = () => { | ||
const [show, setShow] = useState(false); | ||
const { user } = useContentfulContext(); | ||
|
||
useEffect(() => { | ||
const listener = (changes) => { | ||
if (changes.cma && changes.cma.newValue) { | ||
setShow(true); | ||
} | ||
}; | ||
chrome.storage.sync.onChanged.addListener(listener); | ||
return () => { | ||
chrome.storage.sync.onChanged.removeListener(listener); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<div className={`banner ${show && user && 'show'}`}> | ||
<p>You are now logged in as {user}</p> | ||
<button type="button" onClick={() => setShow(false)}> | ||
X | ||
</button> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default Banner; |
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,3 @@ | ||
import Banner from './Banner'; | ||
|
||
export default Banner; |
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
Oops, something went wrong.