-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathSidebar.tsx
83 lines (76 loc) · 3.46 KB
/
Sidebar.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* Copyright (c) 2024. Devtron Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ModalSidebarPanel } from '@devtron-labs/devtron-fe-common-lib'
import { DOCUMENTATION } from '@Config/constants'
import { CreationMethodType, SidebarProps } from './types'
const Sidebar = ({
selectedCreationMethod,
handleCreationMethodChange,
createMethodConfig,
isJobView,
}: SidebarProps) => {
const getHandleCreationMethodChange = (creationMethod: CreationMethodType) => () => {
handleCreationMethodChange(creationMethod)
}
return (
<div className="w-250 p-20 flexbox-col dc__gap-24 dc__no-shrink dc__overflow-auto">
<div className="flexbox-col">
{createMethodConfig.map(({ label, value, startIcon }) => {
const isSelected = value === selectedCreationMethod
return (
<button
className={`dc__transparent flex left dc__gap-8 py-6 px-8 br-4 ${isSelected ? 'bcb-1' : 'dc__hover-n50'}`}
key={value}
aria-label={`Creation method: ${label}`}
type="button"
onClick={getHandleCreationMethodChange(value)}
>
<span className="dc__fill-available-space dc__no-shrink icon-dim-16">{startIcon}</span>
<span className={`fs-13 lh-20 dc__truncate ${isSelected ? 'cb-5 fw-6' : 'cn-9'}`}>
{label}
</span>
</button>
)
})}
</div>
{!isJobView && (
<>
<div className="divider__secondary--horizontal" />
<ModalSidebarPanel
heading={null}
documentationLink={DOCUMENTATION.APP_CREATE}
rootClassName="w-100 dc__no-background-imp"
>
<div className="flexbox-col dc__gap-24">
<p className="m-0">
In Devtron, an "Application" represents your software project or service.
</p>
<p className="m-0">
It serves as a container for your deployment configurations, environments, and other
settings. Define your application to start managing and monitoring its deployment
efficiently.
</p>
<p className="m-0">
Applications are not environment specific and can be deployed to multiple environments.
</p>
</div>
</ModalSidebarPanel>
</>
)}
</div>
)
}
export default Sidebar