Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최원석
/
2021-1-database-project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
1seok2
2021-05-05 22:02:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
20e02947c4b1d63c0c79a48725c0af039f54bae2
20e02947
1 parent
6e217660
refactor: simply render app
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
app/src/App.ts
app/src/components/event.list.ts
app/src/components/functions.ts
app/src/index.ts
app/src/views/header/Header.ts
app/src/App.ts
View file @
20e0294
...
...
@@ -13,7 +13,7 @@ import { getState } from "@src/store/state";
import
"./assets/style/App.scss"
;
import
{
getElement
}
from
"./components/functions"
;
export
default
function
App
(
pathname
:
string
):
string
{
function
App
(
pathname
:
string
):
string
{
/* id 없을 시 id 입력으로 redirect */
if
(
!
getState
().
insta_id
)
pathname
=
""
;
history
.
pushState
(
""
,
""
,
pathname
);
...
...
@@ -27,7 +27,7 @@ export default function App(pathname: string): string {
`
;
}
export
function
renderApp
(
pathname
:
string
):
void
{
export
default
function
renderApp
(
pathname
:
string
):
void
{
const
$App
=
getElement
(
"#App"
)
as
HTMLDivElement
;
$App
.
innerHTML
=
App
(
pathname
);
...
...
app/src/components/event.list.ts
View file @
20e0294
import
{
randomTransition
}
from
"@src/components/page.transition"
;
import
{
renderApp
}
from
"@src/App"
;
import
renderApp
from
"@src/App"
;
import
{
getElement
,
pendingFetch
,
...
...
app/src/components/functions.ts
View file @
20e0294
...
...
@@ -2,7 +2,7 @@ import { BASE_URL } from "@src/config/url";
import
{
setState
}
from
"@src/store/state"
;
import
{
togglePageLoader
}
from
"@src/components/page.loader"
;
import
{
randomTransition
}
from
"@src/components/page.transition"
;
import
{
renderApp
}
from
"@src/App"
;
import
renderApp
from
"@src/App"
;
export
function
formatNumber
(
number
:
number
):
string
{
if
(
`
${
number
}
`
.
length
>
6
)
{
...
...
app/src/index.ts
View file @
20e0294
...
...
@@ -13,7 +13,7 @@ import addEventWithElementByType from "@src/components/add.event";
import
{
getPathname
}
from
"@src/components/functions"
;
import
{
linkEvent
}
from
"@src/components/event.list"
;
import
{
renderApp
}
from
"./App"
;
import
renderApp
from
"./App"
;
window
.
addEventListener
(
"DOMContentLoaded"
,
()
=>
{
createLoaderElement
();
...
...
app/src/views/header/Header.ts
View file @
20e0294
...
...
@@ -6,7 +6,7 @@
import
"@src/assets/style/Header.scss"
;
import
{
renderApp
}
from
"@src/App"
;
import
renderApp
from
"@src/App"
;
import
addEventWithElementByType
from
"@src/components/add.event"
;
import
{
handleFetchById
}
from
"@src/components/event.list"
;
...
...
Please
register
or
login
to post a comment