-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to log in to other solid identity providers
+ multiple styling changes + highlight both knows and known, also include them in node radius
- Loading branch information
Showing
7 changed files
with
159 additions
and
33 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 |
---|---|---|
@@ -1,18 +1,23 @@ | ||
# Friend Crawler | ||
# Solid Friend Crawler | ||
|
||
[live version](https://friends.livegraph.org) | ||
Live at [friends.livegraph.org](https://friends.livegraph.org) | ||
|
||
Visualize the network of friends on Solid | ||
|
||
The app starts at the logged user (and timbl on solidcommunity.net) and crawls the foaf:knows connections. | ||
|
||
## TODO | ||
|
||
- [x] add people to history of browser (will allow browsing) | ||
- [x] make people a variable size based on how many people know them | ||
- [ ] show clearly what are the directions of :knows | ||
- [x] show also who knows this person | ||
- [ ] login for different pod providers | ||
- [x] login for different pod providers | ||
- [x] faster (parallel) crawling | ||
- [x] search people | ||
- [ ] make it more accessible and easier to navigate | ||
- [ ] highlight also people who know the person | ||
- [x] highlight also people who know the person | ||
- [ ] highlight people whose button is crawled in PersonList | ||
- [ ] add custom starting point for crawling | ||
- [x] support extended profile (seeAlso, sameAs) | ||
- [ ] figure hosting it as SPA with router |
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,101 @@ | ||
import React, { useState } from 'react' | ||
import Modal from 'react-modal' | ||
|
||
interface Props { | ||
onLogin: (oidcIssuer: string) => void | ||
} | ||
|
||
const LoginPrompt: React.FC<Props> = ({ onLogin, ...props }: Props) => { | ||
const [promptOpen, setPromptOpen] = useState(false) | ||
const [idp, setIdp] = useState( | ||
localStorage.getItem('idp') ?? 'https://solidcommunity.net', | ||
) | ||
|
||
const onSubmit: React.FormEventHandler = e => { | ||
e.preventDefault() | ||
localStorage.setItem('idp', idp) | ||
onLogin(idp) | ||
} | ||
|
||
const onChangeInput = (e: React.FormEvent<HTMLInputElement>) => { | ||
e.preventDefault() | ||
const newValue = e.currentTarget.value | ||
setIdp(newValue) | ||
} | ||
|
||
if (!promptOpen) { | ||
return ( | ||
<> | ||
<button | ||
{...props} | ||
onClick={e => { | ||
e.preventDefault() | ||
setPromptOpen(true) | ||
}} | ||
> | ||
Login | ||
</button> | ||
</> | ||
) | ||
} | ||
|
||
return ( | ||
<> | ||
<Modal | ||
isOpen={promptOpen} | ||
onRequestClose={() => setPromptOpen(false)} | ||
contentLabel="Connect your Solid Pod" | ||
overlayClassName={{ | ||
base: 'modal modal-background is-active', | ||
afterOpen: '', | ||
beforeClose: '', | ||
}} | ||
className={{ | ||
base: 'modal-content', | ||
afterOpen: '', | ||
beforeClose: '', | ||
}} | ||
closeTimeoutMS={50} | ||
> | ||
<button className="modal-close" onClick={() => setPromptOpen(false)}> | ||
close | ||
</button> | ||
|
||
<div className="card"> | ||
<header className="card-header"> | ||
<p className="card-header-title"> | ||
Select your Solid identity provider | ||
</p> | ||
</header> | ||
<div className="card-content"> | ||
<form onSubmit={onSubmit}> | ||
<div className="field"> | ||
<div className="control"> | ||
<input | ||
id="idp" | ||
className="input" | ||
type="url" | ||
value={idp} | ||
onChange={onChangeInput} | ||
placeholder="Where is your Solid Pod?" | ||
/> | ||
</div> | ||
</div> | ||
<div className="field"> | ||
<div className="control"> | ||
<input | ||
type="submit" | ||
value="Connect" | ||
className="button is-link" | ||
/> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</Modal> | ||
</> | ||
) | ||
} | ||
|
||
export default LoginPrompt |
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