23 |
24 |
31 | {this.props.children}
32 |
33 |
34 | )
35 | }
36 | }
37 |
38 | export const PageContent = withWidth()(withStyles(styles)(PageContentComponent))
39 |
--------------------------------------------------------------------------------
/backend/blueprints/spa_api/service_layers/logged_in_user.py:
--------------------------------------------------------------------------------
1 | from flask import g
2 |
3 | from backend.blueprints.steam import get_steam_profile_or_random_response
4 | from backend.utils.checks import is_local_dev
5 | from backend.blueprints.spa_api.errors.errors import NotLoggedIn
6 |
7 |
8 | class LoggedInUser:
9 | def __init__(self, name: str, id_: str, avatar_link: str, admin: bool, alpha: bool, beta: bool):
10 | self.name = name
11 | self.id = id_
12 | self.avatarLink = avatar_link
13 | self.admin = admin
14 | self.alpha = alpha
15 | self.beta = beta
16 |
17 | @staticmethod
18 | def create() -> 'LoggedInUser':
19 | if is_local_dev():
20 | mock_steam_profile = get_steam_profile_or_random_response("TESTLOCALUSER")['response']['players'][0]
21 | name = mock_steam_profile['personaname']
22 | id_ = mock_steam_profile['steamid']
23 | avatar_link = mock_steam_profile['avatarfull']
24 | return LoggedInUser(name, id_, avatar_link, True, True, True)
25 | if g.user is None:
26 | raise NotLoggedIn()
27 | return LoggedInUser(g.user.platformname, g.user.platformid, g.user.avatar, g.admin, g.admin or g.alpha,
28 | g.admin or g.alpha or g.beta)
29 |
--------------------------------------------------------------------------------
/webapp/src/Utils/CopyToClipboard/clipboard.d.ts:
--------------------------------------------------------------------------------
1 | /*
2 | The MIT License (MIT)
3 |
4 | Copyright (c) Feross Aboukhadijeh
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of
7 | this software and associated documentation files (the "Software"), to deal in
8 | the Software without restriction, including without limitation the rights to
9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10 | the Software, and to permit persons to whom the Software is furnished to do so,
11 | subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | */
23 |
24 | declare function clipboardCopy(text: string): Promise