@tsei/note
v0.1.1
Published
🌌Fantastic UI in tsei.jp/note
Maintainers
Readme
Install via npm
npm i -S @tsei/note
Get Started
git clone https://github.com/tseijp/notecd note,npm iandnpm start- open browser and visit http://localhost:3000
- Now you can go to our demo, and try its usage.
Recipes
Note
manage note data and apiconst [note, set] = useNote(url, fetcher, config)
<Note url="..."
fetcher={...}
{...config}>
{(note, set) =>
<>{/*_*/}</>
}
</Note>- @url: string
- @fetcher: function
- @config: object
- @note: Note
- @set: function
User
manage user info and APIconst [user, set] = useUser(url, fetcher, config)
<User url="..."
fetcher={...}
{...config}>
{(user, set) =>
<>{/*_*/}</>
}
</User>- @url: string
- @fetcher: function
- @config : object
@user:
User- @username : user name from fetched API e.g. tseijp
- @authtoken: user token from cookie
- @input : for input Components
- @status : the acton at fetch e.g. IN, UP, OUT or ""
- @userlang : user language from window.navigator.language e.g. ja, en
@set:
setUser(): Toggle fetching- ~
setUser(null): switch status IN->UP or UP->IN~ - ~
setUser(boolean): switch status '' or IN|UP|OUT~
Available API
URL |Description :----------|:- /auth/ |Distribute Auth Token /api/ |Restful Api Router /api/note/ |Note Api
key of /api/note |Description
:----------------------|:-
next |next pagination url
previous |previous pagination url
results |seriaized data as array
results[0].id |primary key
results[0].note_id |primary key of parent
results[0].ja_text |text data
results[0].en_text |text data
results[0].is_author |whether request user is author
results[0].posted_time |time when it was posted
results[0].author_name |username of posted user
