unistore sucks i think
This commit is contained in:
1 parent
baeaead650
commit
02aadcf2db
21 files changed
+4468
-1354
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { h } from 'preact';
|
||||
import { connect } from 'unistore/preact'
|
||||
|
||||
import actions from './../actions';
|
||||
|
||||
function Home({ bundles, getBundles }) {
|
||||
if (!bundles.length) {
|
||||
getBundles();
|
||||
|
||||
return (
|
||||
<div class={'home'}>
|
||||
loading...
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div class={'home'}>
|
||||
{JSON.stringify(bundles)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default connect('bundles', actions)(Home);
|
||||
@@ -1,11 +0,0 @@
|
||||
import { h } from 'preact';
|
||||
import style from './style.less';
|
||||
|
||||
const Home = () => (
|
||||
<div class={style.home}>
|
||||
<h1>Home</h1>
|
||||
<p>This is the Home component.</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default Home;
|
||||
@@ -1,5 +0,0 @@
|
||||
.home {
|
||||
padding: 56px 20px;
|
||||
min-height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -6,7 +6,6 @@ interface Props {
|
||||
user: string;
|
||||
}
|
||||
|
||||
// Note: `user` comes from the URL, courtesy of our router
|
||||
const Profile = ({ user }: Props) => {
|
||||
const [time, setTime] = useState<number>(Date.now());
|
||||
const [count, setCount] = useState<number>(0);
|
||||
@@ -18,7 +17,7 @@ const Profile = ({ user }: Props) => {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div class={style.profile}>
|
||||
<div class={'profile'}>
|
||||
<h1>Profile: {user}</h1>
|
||||
<p>This is the user profile for a user named { user }.</p>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
.profile {
|
||||
padding: 56px 20px;
|
||||
min-height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
Reference in new issue
Block a user