mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-23 12:54:06 -06:00
Removing #3, as we're replacing it. Also adding some stuff for acord-robotics/stellarios
This commit is contained in:
parent
3d89f79fd0
commit
f3ace466df
@ -2,4 +2,6 @@
|
||||
title: "Private Stuff"
|
||||
---
|
||||
|
||||
This page doesn't get published!
|
||||
This page doesn't get published!
|
||||
|
||||
Original AoD Portal: https://drive.google.com/drive/folders/1Mm1gNJJnw_60izyuI7XfinMPy2zC24Vs?usp=sharing
|
||||
@ -1,11 +0,0 @@
|
||||
const EventComponent: React.FC = () => {
|
||||
const onChange = (e) => {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
return <div>
|
||||
<input onChange={onChange} />
|
||||
</div>
|
||||
};
|
||||
|
||||
export default EventComponent;
|
||||
@ -1,14 +0,0 @@
|
||||
import ReactDOM from 'react-dom';
|
||||
//import UserSearch from './state/UserSearch'
|
||||
//import List from './state/List'
|
||||
import EventComponent from './events/EventComponent';
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
<div>
|
||||
<EventComponent />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('root'));
|
||||
@ -1,20 +0,0 @@
|
||||
interface ChildProps {
|
||||
colour: string;
|
||||
onClick: () => void;
|
||||
}
|
||||
|
||||
export const Child = ({ colour, onClick }: ChildProps) => {
|
||||
return <div>
|
||||
{colour}
|
||||
<button onClick={onClick}>Click me</button>
|
||||
</div>
|
||||
};
|
||||
|
||||
export const ChildAsReactFC: React.FC<ChildProps> = ({ colour, onClick, children }) => {
|
||||
return <div>
|
||||
{colour}
|
||||
<button onClick={onClick}>Click me</button>
|
||||
</div>
|
||||
};
|
||||
|
||||
//ChildAsReactFC.displayName = 'ChildAsReactFC';
|
||||
@ -1,9 +0,0 @@
|
||||
import { ChildAsReactFC } from './Child';
|
||||
|
||||
const Parent = () => {
|
||||
return <ChildAsReactFC colour="red" onClick={() => console.log('Clicked')}>;
|
||||
Nothing
|
||||
</ChildAsReactFC>
|
||||
};
|
||||
|
||||
export default Parent;
|
||||
1
quartz-cli/src/react-app-env.d.ts
vendored
1
quartz-cli/src/react-app-env.d.ts
vendored
@ -1 +0,0 @@
|
||||
/// <reference types="react-scripts" />
|
||||
@ -1,25 +0,0 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
const List: React.FC = () => {
|
||||
const [name, setName] = useState('');
|
||||
const [users, setUsers] = useState<string[]>([]);
|
||||
|
||||
const onClick = () => {
|
||||
setName('');
|
||||
setUsers([...users, name]); // Take current users array and add current name to the end
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h3>List</h3>
|
||||
<ul>
|
||||
{users.map(user => <li key={user}>{user}</li>)}
|
||||
</ul>
|
||||
<input value={name} onChange={(e) => setName(e.target.value)} />
|
||||
<button onClick={onClick}>Add item</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default List;
|
||||
@ -1,32 +0,0 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
const users = [
|
||||
{ name: 'Hello', age: 20 },
|
||||
{ name: 'There', age: 20 },
|
||||
{ name: 'World', age: 20 },
|
||||
];
|
||||
|
||||
const UserSearch: React.FC = () => {
|
||||
const [name, setName] = useState('');
|
||||
const [user, setUser] = useState<{ name: string, age: number } | undefined>(); // Two types of values/results from a search
|
||||
|
||||
const onClick = () => {
|
||||
const foundUser = users.find((user) => {
|
||||
return user.name === name; // Connect the result of the search to the `foundUser` variable
|
||||
});
|
||||
|
||||
setUser(foundUser);
|
||||
};
|
||||
|
||||
return <div>
|
||||
User Search
|
||||
<input value={name} onChange={e => setName(e.target.value)} />
|
||||
<button onClick={onClick}>Find User</button>
|
||||
<div>
|
||||
{user && user.name}
|
||||
{user && user.age}
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
||||
export default UserSearch;
|
||||
Loading…
Reference in New Issue
Block a user