mirror of
https://github.com/hubHarmony/servii-frontend.git
synced 2024-11-17 21:40:30 +00:00
commit
ac73fa7920
@ -8,7 +8,6 @@ import bukkitLogo from '../../assets/frameworks/bukkit.png';
|
||||
import paperLogo from '../../assets/frameworks/paper.png';
|
||||
import spigotLogo from '../../assets/frameworks/spigot.png';
|
||||
|
||||
|
||||
const frameworks = [
|
||||
{ name: 'vanilla', logo: vanillaLogo },
|
||||
{ name: 'bukkit', logo: bukkitLogo },
|
||||
@ -39,8 +38,6 @@ const versions = {
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
|
||||
const CreateServer = ({ user, onCreateServer, onSubdomainUpdate, onCancel, noServers }) => {
|
||||
const [subdomain, setSubdomain] = useState(null);
|
||||
const [subdomainInput, setSubdomainInput] = useState('');
|
||||
@ -78,7 +75,7 @@ const CreateServer = ({ user, onCreateServer, onSubdomainUpdate, onCancel, noSer
|
||||
|
||||
const handleCreateServer = async () => {
|
||||
try {
|
||||
await onCreateServer(serverName, serverVersion , selectedFramework);
|
||||
await onCreateServer(serverName, serverVersion, selectedFramework);
|
||||
} catch (error) {
|
||||
console.error('Error creating server:', error);
|
||||
}
|
||||
@ -93,7 +90,7 @@ const CreateServer = ({ user, onCreateServer, onSubdomainUpdate, onCancel, noSer
|
||||
{noServers ? (
|
||||
<div className={styles.mainCardNoserveur}>
|
||||
<div className={styles.nsSubTitle}>Bonjour</div>
|
||||
<div className={styles.nsTitle}>Aucun serveur </div>
|
||||
<div className={styles.nsTitle}>Aucun serveur</div>
|
||||
<button className={styles.btnnoServCreate} onClick={onCreateServer}>Créer un nouveau serveur</button>
|
||||
</div>
|
||||
) : (
|
||||
@ -133,30 +130,28 @@ const CreateServer = ({ user, onCreateServer, onSubdomainUpdate, onCancel, noSer
|
||||
|
||||
<div className={styles.subtitle}>Sélection du framework</div>
|
||||
<div className={styles.carreContainer}>
|
||||
|
||||
{frameworks.map((framework, index) => (
|
||||
{frameworks.map((framework, index) => (
|
||||
<img
|
||||
key={index}
|
||||
className={`${styles.carre} ${selectedFramework === framework.name ? styles.selected : ''}`}
|
||||
src={framework.logo.toLowerCase()}
|
||||
alt={`${framework.name} Logo`}
|
||||
src={framework.logo}
|
||||
alt={`${framework.name}`}
|
||||
onClick={() => {
|
||||
setSelectedFramework(framework.name);
|
||||
setServerVersion('');
|
||||
setServerVersion('');
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className={styles.subtitle}>Sélection de la version</div>
|
||||
|
||||
<select
|
||||
className={styles.select}
|
||||
name="version"
|
||||
id="version-select"
|
||||
value={serverVersion}
|
||||
onChange={(e) => setServerVersion(e.target.value)}
|
||||
disabled={!selectedFramework}
|
||||
disabled={!selectedFramework}
|
||||
>
|
||||
<option>Version</option>
|
||||
{selectedFramework && versions[selectedFramework].map((version, index) => (
|
||||
|
Loading…
Reference in New Issue
Block a user