switch to a new domain name
This commit is contained in:
parent
2aafdec40b
commit
86b57dcbd0
@ -1,5 +1,5 @@
|
||||
{
|
||||
"homepage": "http://spectralitree.github.io/pk-webs",
|
||||
"homepage": "https://pk-webs.spectralitree.com",
|
||||
"name": "pk-web",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
|
@ -22,7 +22,7 @@
|
||||
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
|
||||
// https://username.github.io/repo-name/?/one/two&a=b~and~c=d#qwe
|
||||
// Otherwise, leave pathSegmentsToKeep as 0.
|
||||
var pathSegmentsToKeep = 1;
|
||||
var pathSegmentsToKeep = 0;
|
||||
|
||||
var l = window.location;
|
||||
l.replace(
|
||||
|
14
src/App.js
14
src/App.js
@ -25,25 +25,25 @@ export default function App() {
|
||||
|
||||
return (
|
||||
<div className={ `contents ${localStorage.getItem('opendyslexic') ? "opendyslexic" : ""}`}>
|
||||
<Router history={history} basename="/pk-webs">
|
||||
<Router history={history}>
|
||||
<Navbar forceUpdate={forceUpdate} setIsSubmit={setIsSubmit} />
|
||||
<div className="content">
|
||||
<BS.Container>
|
||||
<Switch>
|
||||
<Route path="/pk-webs/dash">
|
||||
{ !localStorage.getItem('token') || isInvalid ? <Redirect to="/pk-webs"/> : <Dash />
|
||||
<Route path="/dash">
|
||||
{ !localStorage.getItem('token') || isInvalid ? <Redirect to="/"/> : <Dash />
|
||||
}
|
||||
</Route>
|
||||
<Route exact path="/pk-webs">
|
||||
<Route exact path="/">
|
||||
<Home isLoading={isLoading} setIsLoading={setIsLoading} isSubmit={isSubmit} setIsSubmit={setIsSubmit} isInvalid={isInvalid} setIsInvalid={setIsInvalid}/>
|
||||
</Route>
|
||||
<Route path="/pk-webs/profile">
|
||||
<Route path="/profile">
|
||||
<Public />
|
||||
</Route>
|
||||
<Route path="/pk-webs/settings">
|
||||
<Route path="/settings">
|
||||
<Settings forceUpdate={forceUpdate}/>
|
||||
</Route>
|
||||
<Route path="/pk-webs/template">
|
||||
<Route path="/template">
|
||||
<Template/>
|
||||
</Route>
|
||||
</Switch>
|
||||
|
@ -10,7 +10,7 @@ export default function Navigation() {
|
||||
</BS.Nav.Link>
|
||||
</BS.Nav.Item>
|
||||
<BS.Nav.Item>
|
||||
<BS.Nav.Link rel="noreferrer" target="_blank" href="https://github.com/Spectralitree/pk-webs/">
|
||||
<BS.Nav.Link rel="noreferrer" target="_blank" href="https://pk-webs.spectralitree.com/">
|
||||
Github
|
||||
</BS.Nav.Link>
|
||||
</BS.Nav.Item>
|
||||
|
@ -14,21 +14,21 @@ const Navbar = ({ setIsSubmit, forceUpdate}) => {
|
||||
setIsSubmit(false);
|
||||
localStorage.removeItem("token");
|
||||
localStorage.removeItem("user");
|
||||
history.push("/pk-webs");
|
||||
history.push("/");
|
||||
forceUpdate();
|
||||
}
|
||||
|
||||
return(
|
||||
<BS.Navbar className="mb-5 align-items-center">
|
||||
<BS.Navbar.Brand href="/pk-webs">
|
||||
<BS.Navbar.Brand href="/">
|
||||
pk-webs
|
||||
</BS.Navbar.Brand>
|
||||
<BS.NavDropdown id="menu" className="mr-auto" title="Menu">
|
||||
{/* for some reason just using react router's link elements doesn't work here, maybe look into that */}
|
||||
<BS.NavDropdown.Item onClick={() => history.push('/pk-webs/dash')} >Dash</BS.NavDropdown.Item>
|
||||
<BS.NavDropdown.Item onClick={() => history.push('/pk-webs/settings')} >Settings</BS.NavDropdown.Item>
|
||||
<BS.NavDropdown.Item onClick={() => history.push('/pk-webs/template')}>Templates</BS.NavDropdown.Item>
|
||||
<BS.NavDropdown.Item onClick={() => history.push('/pk-webs/profile')}>Public profile</BS.NavDropdown.Item>
|
||||
<BS.NavDropdown.Item onClick={() => history.push('/dash')} >Dash</BS.NavDropdown.Item>
|
||||
<BS.NavDropdown.Item onClick={() => history.push('/settings')} >Settings</BS.NavDropdown.Item>
|
||||
<BS.NavDropdown.Item onClick={() => history.push('/template')}>Templates</BS.NavDropdown.Item>
|
||||
<BS.NavDropdown.Item onClick={() => history.push('/profile')}>Public profile</BS.NavDropdown.Item>
|
||||
{ localStorage.getItem('token') ? <><hr className="my-1"/><BS.NavDropdown.Item onClick={() => logOut()}>Log out</BS.NavDropdown.Item></> : "" }
|
||||
|
||||
</BS.NavDropdown>
|
||||
|
@ -212,7 +212,7 @@ export default function MemberCard(props) {
|
||||
}
|
||||
|
||||
function copyLink() {
|
||||
var link = `https://spectralitree.github.io/pk-webs/profile/${sysID}/${member.id}`
|
||||
var link = `https://pk-webs.spectralitree.com/profile/${sysID}/${member.id}`
|
||||
var textField = document.createElement('textarea')
|
||||
textField.innerText = link
|
||||
document.body.appendChild(textField);
|
||||
|
@ -213,7 +213,7 @@ export default function MemberPage(props) {
|
||||
}
|
||||
|
||||
function copyLink() {
|
||||
var link = `https://spectralitree.github.io/pk-webs/profile/${sysID}/${member.id}`
|
||||
var link = `https://pk-webs.spectralitree.com/profile/${sysID}/${member.id}`
|
||||
var textField = document.createElement('textarea')
|
||||
textField.innerText = link
|
||||
document.body.appendChild(textField);
|
||||
@ -229,7 +229,7 @@ export default function MemberPage(props) {
|
||||
memberDeleted ? <BS.Card className="mb-5"><BS.Card.Header className="d-flex align-items-center justify-content-between"><BS.Button variant="link" className="float-left"><FaTrashAlt className="mr-4"/>Member Deleted</BS.Button></BS.Card.Header>
|
||||
<BS.Card.Body>
|
||||
Member successfully deleted, click the button below to go back to the dash.
|
||||
<BS.Button variant="primary" className="float-right" onClick={() => history.push("/pk-webs/dash/reload")}>Back</BS.Button>
|
||||
<BS.Button variant="primary" className="float-right" onClick={() => history.push("/dash/reload")}>Back</BS.Button>
|
||||
</BS.Card.Body></BS.Card> :
|
||||
<>
|
||||
{ localStorage.getItem('colorbg') ? "" : member.color ? <><div className="backdrop" style={{backgroundColor: `#${color}`}}/>
|
||||
@ -421,7 +421,7 @@ export default function MemberPage(props) {
|
||||
<hr/></> : "" }
|
||||
<p><b>Description:</b></p>
|
||||
{ localStorage.getItem('twemoji') ? <Twemoji options={{ className: 'twemoji' }}><p dangerouslySetInnerHTML={{__html: desc}}></p></Twemoji> : <p dangerouslySetInnerHTML={{__html: desc}}></p>}
|
||||
{ proxyView ? "" : privacyMode ? "" : privacyView ? "" : <><BS.Button variant="light" onClick={() => setEditMode(true)}>Edit</BS.Button> <Link to="/pk-webs/dash" ><BS.Button variant="primary" className="float-right">Back</BS.Button></Link></>}
|
||||
{ proxyView ? "" : privacyMode ? "" : privacyView ? "" : <><BS.Button variant="light" onClick={() => setEditMode(true)}>Edit</BS.Button> <Link to="/dash" ><BS.Button variant="primary" className="float-right">Back</BS.Button></Link></>}
|
||||
</> } </BS.Card.Body></BS.Card></>
|
||||
)
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import EditSystemPrivacy from "./Edit/EditSystemPrivacy.js";
|
||||
|
||||
export default function System(props) {
|
||||
// match the url, if there's a member ID there, don't render this component at all
|
||||
const match = useRouteMatch("/pk-webs/dash/:memberID");
|
||||
const match = useRouteMatch("/dash/:memberID");
|
||||
|
||||
// get the user from the localstorage
|
||||
const [user, setUser] = useState(JSON.parse(localStorage.getItem("user")));
|
||||
@ -230,7 +230,7 @@ export default function System(props) {
|
||||
<BS.Button
|
||||
variant="primary"
|
||||
className="float-right"
|
||||
onClick={() => history.push(`/pk-webs/profile/${user.id}`)}
|
||||
onClick={() => history.push(`/profile/${user.id}`)}
|
||||
>
|
||||
Profile
|
||||
</BS.Button>
|
||||
|
@ -13,7 +13,7 @@ import ProfileList from "./ProfileList.js";
|
||||
|
||||
export default function Profile () {
|
||||
|
||||
const match = useRouteMatch("/pk-webs/profile/:sysID/:memberID");
|
||||
const match = useRouteMatch("/profile/:sysID/:memberID");
|
||||
|
||||
const { sysID } = useParams();
|
||||
const [ system, setSystem ] = useState('');
|
||||
|
@ -66,7 +66,7 @@ export default function MemberCard(props) {
|
||||
}, [member.description, member.color, member.birthday, member.display_name, member.pronouns, member.avatar_url, member.proxy_tags]);
|
||||
|
||||
function copyLink() {
|
||||
var link = `https://spectralitree.github.io/pk-webs/profile/${sysID}/${member.id}`
|
||||
var link = `https://pk-webs.spectralitree.com/profile/${sysID}/${member.id}`
|
||||
var textField = document.createElement('textarea')
|
||||
textField.innerText = link
|
||||
document.body.appendChild(textField);
|
||||
|
@ -238,7 +238,7 @@ export default function Memberlist() {
|
||||
}
|
||||
</>
|
||||
</Route>
|
||||
<Route path={`/pk-webs/profile/${sysID}/:memberID`}>
|
||||
<Route path={`/profile/${sysID}/:memberID`}>
|
||||
{ isLoading ? <Loading/> :
|
||||
<ProfilePages members={members}/>}
|
||||
</Route>
|
||||
|
@ -39,7 +39,7 @@ const { register, handleSubmit } = useForm();
|
||||
localStorage.setItem("user", JSON.stringify(data));
|
||||
setIsSubmit(true);
|
||||
setIsLoading(false);
|
||||
history.push("/pk-webs/dash");
|
||||
history.push("/dash");
|
||||
})
|
||||
// remove the token and user data from localstorage if there's an error, also set the token as invalid
|
||||
// TODO: an error doesn't mean the token is invalid, change this depending on what error is thrown
|
||||
@ -122,7 +122,7 @@ const { register, handleSubmit } = useForm();
|
||||
</p>
|
||||
<BS.Button
|
||||
type="primary"
|
||||
onClick={() => history.push("/pk-webs/dash")}
|
||||
onClick={() => history.push("/dash")}
|
||||
>
|
||||
Continue to dash
|
||||
</BS.Button>
|
||||
|
@ -6,7 +6,7 @@ import './index.css';
|
||||
import App from './App';
|
||||
|
||||
ReactDOM.render(
|
||||
<Router history={history} basename="/pk-webs">
|
||||
<Router history={history}>
|
||||
<App />
|
||||
</Router>,
|
||||
document.getElementById('root')
|
||||
|
Loading…
x
Reference in New Issue
Block a user